/**
* Creates a chain executor for the given sub graph of layouts, that last started at the given time, at the given
* refresh period.
*
* @param graph dependency graph
* @param subGraph sub graph
* @param startTimeOfLastChain last start time of the chain
* @param refreshPeriod refresh period
* @return chain executor
*/
private ChainExecutor createChainExecutor(DirectedGraph<DependencyNode, DefaultEdge> graph,
DirectedGraph<DependencyNode, DefaultEdge> subGraph,
long startTimeOfLastChain, long refreshPeriod, long gracePeriod) {
final List<Layout> layouts = FluentIterable.from(TopologicalOrderIterator.of(subGraph))
.transform(new Function<DependencyNode, Layout>() {
@Override
public Layout apply(DependencyNode node) {
return node.getLayout();
}
}).toList();
String uuid = UUID.randomUUID().toString();
String rootId = layouts.get(0).getId().getId();
logger.info("Creating chain executor for root node {} with id {}.", rootId, uuid);
if (logger.isDebugEnabled()) {
logger.debug("Sub graph for chain executor {}:{} is: {}.", rootId, uuid, layouts.toString());
}
return new ChainExecutor(graph, layouts, startTimeOfLastChain, refreshPeriod, gracePeriod, schedulerService,
materializationContext, accelerationService.getSettings().getLayoutRefreshMaxAttempts(), rootId + ":" + uuid);
}
DependencyGraph.java 文件源码
java
阅读 42
收藏 0
点赞 0
评论 0
项目:dremio-oss
作者:
评论列表
文章目录