Search in sources :

Example 1 with InputPriorityConflictResolver

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;
}
Also used : BatchExecNode(org.apache.flink.table.planner.plan.nodes.exec.batch.BatchExecNode) StreamExchangeMode(org.apache.flink.streaming.api.transformations.StreamExchangeMode) InputPriorityConflictResolver(org.apache.flink.table.planner.plan.nodes.exec.processor.utils.InputPriorityConflictResolver) InputProperty(org.apache.flink.table.planner.plan.nodes.exec.InputProperty) TableException(org.apache.flink.table.api.TableException) ExecNodeGraph(org.apache.flink.table.planner.plan.nodes.exec.ExecNodeGraph) TableException(org.apache.flink.table.api.TableException) BatchExecNode(org.apache.flink.table.planner.plan.nodes.exec.batch.BatchExecNode) InputPriorityConflictResolver(org.apache.flink.table.planner.plan.nodes.exec.processor.utils.InputPriorityConflictResolver)

Example 2 with InputPriorityConflictResolver

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);
}
Also used : ExecNodeGraph(org.apache.flink.table.planner.plan.nodes.exec.ExecNodeGraph) ExecNode(org.apache.flink.table.planner.plan.nodes.exec.ExecNode) InputPriorityConflictResolver(org.apache.flink.table.planner.plan.nodes.exec.processor.utils.InputPriorityConflictResolver)

Aggregations

ExecNodeGraph (org.apache.flink.table.planner.plan.nodes.exec.ExecNodeGraph)2 InputPriorityConflictResolver (org.apache.flink.table.planner.plan.nodes.exec.processor.utils.InputPriorityConflictResolver)2 StreamExchangeMode (org.apache.flink.streaming.api.transformations.StreamExchangeMode)1 TableException (org.apache.flink.table.api.TableException)1 ExecNode (org.apache.flink.table.planner.plan.nodes.exec.ExecNode)1 InputProperty (org.apache.flink.table.planner.plan.nodes.exec.InputProperty)1 BatchExecNode (org.apache.flink.table.planner.plan.nodes.exec.batch.BatchExecNode)1