use of org.apache.flink.table.planner.plan.nodes.exec.processor.utils.InputPriorityConflictResolver in project flink by apache.
the class DeadlockBreakupProcessor method process.
@Override
public ExecNodeGraph process(ExecNodeGraph execGraph, ProcessorContext context) {
if (!execGraph.getRootNodes().stream().allMatch(r -> r instanceof BatchExecNode)) {
throw new TableException("Only BatchExecNode DAG are supported now.");
}
InputPriorityConflictResolver resolver = new InputPriorityConflictResolver(execGraph.getRootNodes(), InputProperty.DamBehavior.END_INPUT, StreamExchangeMode.BATCH, context.getPlanner().getConfiguration());
resolver.detectAndResolve();
return execGraph;
}
use of org.apache.flink.table.planner.plan.nodes.exec.processor.utils.InputPriorityConflictResolver in project flink by apache.
the class MultipleInputNodeCreationProcessor method process.
@Override
public ExecNodeGraph process(ExecNodeGraph execGraph, ProcessorContext context) {
if (!isStreaming) {
// As multiple input nodes use function call to deliver records between sub-operators,
// we cannot rely on network buffers to buffer records not yet ready to be read,
// so only BLOCKING dam behavior is safe here.
// If conflict is detected under this stricter constraint,
// we add a PIPELINED exchange to mark that its input and output node cannot be merged
// into the same multiple input node
InputPriorityConflictResolver resolver = new InputPriorityConflictResolver(execGraph.getRootNodes(), InputProperty.DamBehavior.BLOCKING, StreamExchangeMode.PIPELINED, context.getPlanner().getConfiguration());
resolver.detectAndResolve();
}
List<ExecNodeWrapper> rootWrappers = wrapExecNodes(execGraph.getRootNodes());
// sort all nodes in topological order, sinks come first and sources come last
List<ExecNodeWrapper> orderedWrappers = topologicalSort(rootWrappers);
// group nodes into multiple input groups
createMultipleInputGroups(orderedWrappers);
// apply optimizations to remove unnecessary nodes out of multiple input groups
optimizeMultipleInputGroups(orderedWrappers, context);
// create the real multiple input nodes
List<ExecNode<?>> newRootNodes = createMultipleInputNodes(rootWrappers);
return new ExecNodeGraph(newRootNodes);
}
Aggregations