Search in sources :

Example 1 with BlockingShuffleOutputFormat

use of org.apache.flink.api.java.io.BlockingShuffleOutputFormat in project flink by apache.

the class JobGraphGenerator method checkAndConfigurePersistentIntermediateResult.

private boolean checkAndConfigurePersistentIntermediateResult(PlanNode node) {
    if (!(node instanceof SinkPlanNode)) {
        return false;
    }
    final Object userCodeObject = node.getProgramOperator().getUserCodeWrapper().getUserCodeObject();
    if (!(userCodeObject instanceof BlockingShuffleOutputFormat)) {
        return false;
    }
    final Iterator<Channel> inputIterator = node.getInputs().iterator();
    checkState(inputIterator.hasNext(), "SinkPlanNode must have a input.");
    final PlanNode predecessorNode = inputIterator.next().getSource();
    final JobVertex predecessorVertex = (vertices.containsKey(predecessorNode)) ? vertices.get(predecessorNode) : chainedTasks.get(predecessorNode).getContainingVertex();
    checkState(predecessorVertex != null, "Bug: Chained task has not been assigned its containing vertex when connecting.");
    predecessorVertex.createAndAddResultDataSet(// use specified intermediateDataSetID
    new IntermediateDataSetID(((BlockingShuffleOutputFormat) userCodeObject).getIntermediateDataSetId()), ResultPartitionType.BLOCKING_PERSISTENT);
    // remove this node so the OutputFormatVertex will not shown in the final JobGraph.
    vertices.remove(node);
    return true;
}
Also used : BlockingShuffleOutputFormat(org.apache.flink.api.java.io.BlockingShuffleOutputFormat) SolutionSetPlanNode(org.apache.flink.optimizer.plan.SolutionSetPlanNode) IterationPlanNode(org.apache.flink.optimizer.plan.IterationPlanNode) BulkIterationPlanNode(org.apache.flink.optimizer.plan.BulkIterationPlanNode) WorksetPlanNode(org.apache.flink.optimizer.plan.WorksetPlanNode) SingleInputPlanNode(org.apache.flink.optimizer.plan.SingleInputPlanNode) WorksetIterationPlanNode(org.apache.flink.optimizer.plan.WorksetIterationPlanNode) SourcePlanNode(org.apache.flink.optimizer.plan.SourcePlanNode) BulkPartialSolutionPlanNode(org.apache.flink.optimizer.plan.BulkPartialSolutionPlanNode) DualInputPlanNode(org.apache.flink.optimizer.plan.DualInputPlanNode) PlanNode(org.apache.flink.optimizer.plan.PlanNode) SinkPlanNode(org.apache.flink.optimizer.plan.SinkPlanNode) NAryUnionPlanNode(org.apache.flink.optimizer.plan.NAryUnionPlanNode) JobVertex(org.apache.flink.runtime.jobgraph.JobVertex) Channel(org.apache.flink.optimizer.plan.Channel) NamedChannel(org.apache.flink.optimizer.plan.NamedChannel) SinkPlanNode(org.apache.flink.optimizer.plan.SinkPlanNode) IntermediateDataSetID(org.apache.flink.runtime.jobgraph.IntermediateDataSetID)

Aggregations

BlockingShuffleOutputFormat (org.apache.flink.api.java.io.BlockingShuffleOutputFormat)1 BulkIterationPlanNode (org.apache.flink.optimizer.plan.BulkIterationPlanNode)1 BulkPartialSolutionPlanNode (org.apache.flink.optimizer.plan.BulkPartialSolutionPlanNode)1 Channel (org.apache.flink.optimizer.plan.Channel)1 DualInputPlanNode (org.apache.flink.optimizer.plan.DualInputPlanNode)1 IterationPlanNode (org.apache.flink.optimizer.plan.IterationPlanNode)1 NAryUnionPlanNode (org.apache.flink.optimizer.plan.NAryUnionPlanNode)1 NamedChannel (org.apache.flink.optimizer.plan.NamedChannel)1 PlanNode (org.apache.flink.optimizer.plan.PlanNode)1 SingleInputPlanNode (org.apache.flink.optimizer.plan.SingleInputPlanNode)1 SinkPlanNode (org.apache.flink.optimizer.plan.SinkPlanNode)1 SolutionSetPlanNode (org.apache.flink.optimizer.plan.SolutionSetPlanNode)1 SourcePlanNode (org.apache.flink.optimizer.plan.SourcePlanNode)1 WorksetIterationPlanNode (org.apache.flink.optimizer.plan.WorksetIterationPlanNode)1 WorksetPlanNode (org.apache.flink.optimizer.plan.WorksetPlanNode)1 IntermediateDataSetID (org.apache.flink.runtime.jobgraph.IntermediateDataSetID)1 JobVertex (org.apache.flink.runtime.jobgraph.JobVertex)1