/** * Creates a new {@code StreamTransformation} with the given name, output type and parallelism. * * @param name The name of the {@code StreamTransformation}, this will be shown in Visualizations and the Log * @param outputType The output type of this {@code StreamTransformation} * @param parallelism The parallelism of this {@code StreamTransformation} */ public StreamTransformation(String name, TypeInformation<T> outputType, int parallelism) { this.id = getNewNodeId(); this.name = Preconditions.checkNotNull(name); this.outputType = outputType; this.parallelism = parallelism; this.slotSharingGroup = null; }
/** * Transforms a {@code PartitionTransformation}. * * <p>For this we create a virtual node in the {@code StreamGraph} that holds the partition * property. @see StreamGraphGenerator */ private <T> Collection<Integer> transformPartition(PartitionTransformation<T> partition) { StreamTransformation<T> input = partition.getInput(); List<Integer> resultIds = new ArrayList<>(); Collection<Integer> transformedIds = transform(input); for (Integer transformedId: transformedIds) { int virtualId = StreamTransformation.getNewNodeId(); streamGraph.addVirtualPartitionNode(transformedId, virtualId, partition.getPartitioner()); resultIds.add(virtualId); } return resultIds; }
/** * Transforms a {@code SelectTransformation}. * * <p>For this we create a virtual node in the {@code StreamGraph} holds the selected names. * * @see org.apache.flink.streaming.api.graph.StreamGraphGenerator */ private <T> Collection<Integer> transformSelect(SelectTransformation<T> select) { StreamTransformation<T> input = select.getInput(); Collection<Integer> resultIds = transform(input); // the recursive transform might have already transformed this if (alreadyTransformed.containsKey(select)) { return alreadyTransformed.get(select); } List<Integer> virtualResultIds = new ArrayList<>(); for (int inputId : resultIds) { int virtualId = StreamTransformation.getNewNodeId(); streamGraph.addVirtualSelectNode(inputId, virtualId, select.getSelectedNames()); virtualResultIds.add(virtualId); } return virtualResultIds; }
/** * Transforms a {@code SideOutputTransformation}. * * <p>For this we create a virtual node in the {@code StreamGraph} that holds the side-output * {@link org.apache.flink.util.OutputTag}. * * @see org.apache.flink.streaming.api.graph.StreamGraphGenerator */ private <T> Collection<Integer> transformSideOutput(SideOutputTransformation<T> sideOutput) { StreamTransformation<?> input = sideOutput.getInput(); Collection<Integer> resultIds = transform(input); // the recursive transform might have already transformed this if (alreadyTransformed.containsKey(sideOutput)) { return alreadyTransformed.get(sideOutput); } List<Integer> virtualResultIds = new ArrayList<>(); for (int inputId : resultIds) { int virtualId = StreamTransformation.getNewNodeId(); streamGraph.addVirtualSideOutputNode(inputId, virtualId, sideOutput.getOutputTag()); virtualResultIds.add(virtualId); } return virtualResultIds; }
/** * Creates a new {@code StreamTransformation} with the given name, output type and parallelism. * * @param name The name of the {@code StreamTransformation}, this will be shown in Visualizations and the Log * @param outputType The output type of this {@code StreamTransformation} * @param parallelism The parallelism of this {@code StreamTransformation} */ public StreamTransformation(String name, TypeInformation<T> outputType, int parallelism) { this.id = getNewNodeId(); this.name = Preconditions.checkNotNull(name); this.outputType = outputType; this.parallelism = parallelism; this.slotSharingGroup = null; }
/** * Creates a new {@code StreamTransformation} with the given name, output type and parallelism. * * @param name The name of the {@code StreamTransformation}, this will be shown in Visualizations and the Log * @param outputType The output type of this {@code StreamTransformation} * @param parallelism The parallelism of this {@code StreamTransformation} */ public StreamTransformation(String name, TypeInformation<T> outputType, int parallelism) { this.id = getNewNodeId(); this.name = Preconditions.checkNotNull(name); this.outputType = outputType; this.parallelism = parallelism; this.slotSharingGroup = null; }
/** * Creates a new {@code StreamTransformation} with the given name, output type and parallelism. * * @param name The name of the {@code StreamTransformation}, this will be shown in Visualizations and the Log * @param outputType The output type of this {@code StreamTransformation} * @param parallelism The parallelism of this {@code StreamTransformation} */ public StreamTransformation(String name, TypeInformation<T> outputType, int parallelism) { this.id = getNewNodeId(); this.name = Preconditions.checkNotNull(name); this.outputType = outputType; this.parallelism = parallelism; this.slotSharingGroup = null; }
/** * Transforms a {@code SelectTransformation}. * * <p>For this we create a virtual node in the {@code StreamGraph} holds the selected names. * * @see org.apache.flink.streaming.api.graph.StreamGraphGenerator */ private <T> Collection<Integer> transformSelect(SelectTransformation<T> select) { StreamTransformation<T> input = select.getInput(); Collection<Integer> resultIds = transform(input); // the recursive transform might have already transformed this if (alreadyTransformed.containsKey(select)) { return alreadyTransformed.get(select); } List<Integer> virtualResultIds = new ArrayList<>(); for (int inputId : resultIds) { int virtualId = StreamTransformation.getNewNodeId(); streamGraph.addVirtualSelectNode(inputId, virtualId, select.getSelectedNames()); virtualResultIds.add(virtualId); } return virtualResultIds; }
/** * Transforms a {@code SideOutputTransformation}. * * <p>For this we create a virtual node in the {@code StreamGraph} that holds the side-output * {@link org.apache.flink.util.OutputTag}. * * @see org.apache.flink.streaming.api.graph.StreamGraphGenerator */ private <T> Collection<Integer> transformSideOutput(SideOutputTransformation<T> sideOutput) { StreamTransformation<?> input = sideOutput.getInput(); Collection<Integer> resultIds = transform(input); // the recursive transform might have already transformed this if (alreadyTransformed.containsKey(sideOutput)) { return alreadyTransformed.get(sideOutput); } List<Integer> virtualResultIds = new ArrayList<>(); for (int inputId : resultIds) { int virtualId = StreamTransformation.getNewNodeId(); streamGraph.addVirtualSideOutputNode(inputId, virtualId, sideOutput.getOutputTag()); virtualResultIds.add(virtualId); } return virtualResultIds; }
/** * Transforms a {@code SelectTransformation}. * * <p>For this we create a virtual node in the {@code StreamGraph} holds the selected names. * * @see org.apache.flink.streaming.api.graph.StreamGraphGenerator */ private <T> Collection<Integer> transformSelect(SelectTransformation<T> select) { StreamTransformation<T> input = select.getInput(); Collection<Integer> resultIds = transform(input); // the recursive transform might have already transformed this if (alreadyTransformed.containsKey(select)) { return alreadyTransformed.get(select); } List<Integer> virtualResultIds = new ArrayList<>(); for (int inputId : resultIds) { int virtualId = StreamTransformation.getNewNodeId(); streamGraph.addVirtualSelectNode(inputId, virtualId, select.getSelectedNames()); virtualResultIds.add(virtualId); } return virtualResultIds; }
/** * Transforms a {@code SideOutputTransformation}. * * <p>For this we create a virtual node in the {@code StreamGraph} that holds the side-output * {@link org.apache.flink.util.OutputTag}. * * @see org.apache.flink.streaming.api.graph.StreamGraphGenerator */ private <T> Collection<Integer> transformSideOutput(SideOutputTransformation<T> sideOutput) { StreamTransformation<?> input = sideOutput.getInput(); Collection<Integer> resultIds = transform(input); // the recursive transform might have already transformed this if (alreadyTransformed.containsKey(sideOutput)) { return alreadyTransformed.get(sideOutput); } List<Integer> virtualResultIds = new ArrayList<>(); for (int inputId : resultIds) { int virtualId = StreamTransformation.getNewNodeId(); streamGraph.addVirtualSideOutputNode(inputId, virtualId, sideOutput.getOutputTag()); virtualResultIds.add(virtualId); } return virtualResultIds; }
/** * Transforms a {@code SideOutputTransformation}. * * <p>For this we create a virtual node in the {@code StreamGraph} that holds the side-output * {@link org.apache.flink.util.OutputTag}. * * @see org.apache.flink.streaming.api.graph.StreamGraphGenerator */ private <T> Collection<Integer> transformSideOutput(SideOutputTransformation<T> sideOutput) { StreamTransformation<?> input = sideOutput.getInput(); Collection<Integer> resultIds = transform(input); // the recursive transform might have already transformed this if (alreadyTransformed.containsKey(sideOutput)) { return alreadyTransformed.get(sideOutput); } List<Integer> virtualResultIds = new ArrayList<>(); for (int inputId : resultIds) { int virtualId = StreamTransformation.getNewNodeId(); streamGraph.addVirtualSideOutputNode(inputId, virtualId, sideOutput.getOutputTag()); virtualResultIds.add(virtualId); } return virtualResultIds; }
/** * Transforms a {@code PartitionTransformation}. * * <p>For this we create a virtual node in the {@code StreamGraph} that holds the partition * property. @see StreamGraphGenerator */ private <T> Collection<Integer> transformPartition(PartitionTransformation<T> partition) { StreamTransformation<T> input = partition.getInput(); List<Integer> resultIds = new ArrayList<>(); Collection<Integer> transformedIds = transform(input); for (Integer transformedId: transformedIds) { int virtualId = StreamTransformation.getNewNodeId(); streamGraph.addVirtualPartitionNode(transformedId, virtualId, partition.getPartitioner()); resultIds.add(virtualId); } return resultIds; }
/** * Transforms a {@code PartitionTransformation}. * * <p>For this we create a virtual node in the {@code StreamGraph} that holds the partition * property. @see StreamGraphGenerator */ private <T> Collection<Integer> transformPartition(PartitionTransformation<T> partition) { StreamTransformation<T> input = partition.getInput(); List<Integer> resultIds = new ArrayList<>(); Collection<Integer> transformedIds = transform(input); for (Integer transformedId: transformedIds) { int virtualId = StreamTransformation.getNewNodeId(); streamGraph.addVirtualPartitionNode(transformedId, virtualId, partition.getPartitioner()); resultIds.add(virtualId); } return resultIds; }
/** * Transforms a {@code SelectTransformation}. * * <p>For this we create a virtual node in the {@code StreamGraph} holds the selected names. * * @see org.apache.flink.streaming.api.graph.StreamGraphGenerator */ private <T> Collection<Integer> transformSelect(SelectTransformation<T> select) { StreamTransformation<T> input = select.getInput(); Collection<Integer> resultIds = transform(input); // the recursive transform might have already transformed this if (alreadyTransformed.containsKey(select)) { return alreadyTransformed.get(select); } List<Integer> virtualResultIds = new ArrayList<>(); for (int inputId : resultIds) { int virtualId = StreamTransformation.getNewNodeId(); streamGraph.addVirtualSelectNode(inputId, virtualId, select.getSelectedNames()); virtualResultIds.add(virtualId); } return virtualResultIds; }
/** * Transforms a {@code PartitionTransformation}. * * <p>For this we create a virtual node in the {@code StreamGraph} that holds the partition * property. @see StreamGraphGenerator */ private <T> Collection<Integer> transformPartition(PartitionTransformation<T> partition) { StreamTransformation<T> input = partition.getInput(); List<Integer> resultIds = new ArrayList<>(); Collection<Integer> transformedIds = transform(input); for (Integer transformedId: transformedIds) { int virtualId = StreamTransformation.getNewNodeId(); streamGraph.addVirtualPartitionNode(transformedId, virtualId, partition.getPartitioner()); resultIds.add(virtualId); } return resultIds; }