Java Code Examples for org.apache.flink.api.dag.Transformation#getParallelism()

The following examples show how to use org.apache.flink.api.dag.Transformation#getParallelism() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FeedbackTransformation.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Adds a feedback edge. The parallelism of the {@code Transformation} must match
 * the parallelism of the input {@code Transformation} of this
 * {@code FeedbackTransformation}
 *
 * @param transform The new feedback {@code Transformation}.
 */
public void addFeedbackEdge(Transformation<T> transform) {

	if (transform.getParallelism() != this.getParallelism()) {
		throw new UnsupportedOperationException(
				"Parallelism of the feedback stream must match the parallelism of the original" +
						" stream. Parallelism of original stream: " + this.getParallelism() +
						"; parallelism of feedback stream: " + transform.getParallelism() +
						". Parallelism can be modified using DataStream#setParallelism() method");
	}

	feedbackEdges.add(transform);
}
 
Example 2
Source File: CoFeedbackTransformation.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Adds a feedback edge. The parallelism of the {@code Transformation} must match
 * the parallelism of the input {@code Transformation} of the upstream
 * {@code Transformation}.
 *
 * @param transform The new feedback {@code Transformation}.
 */
public void addFeedbackEdge(Transformation<F> transform) {

	if (transform.getParallelism() != this.getParallelism()) {
		throw new UnsupportedOperationException(
				"Parallelism of the feedback stream must match the parallelism of the original" +
						" stream. Parallelism of original stream: " + this.getParallelism() +
						"; parallelism of feedback stream: " + transform.getParallelism());
	}

	feedbackEdges.add(transform);
}
 
Example 3
Source File: PartitionTransformation.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new {@code PartitionTransformation} from the given input and
 * {@link StreamPartitioner}.
 *
 * @param input The input {@code Transformation}
 * @param partitioner The {@code StreamPartitioner}
 * @param shuffleMode The {@code ShuffleMode}
 */
public PartitionTransformation(
		Transformation<T> input,
		StreamPartitioner<T> partitioner,
		ShuffleMode shuffleMode) {
	super("Partition", input.getOutputType(), input.getParallelism());
	this.input = input;
	this.partitioner = partitioner;
	this.shuffleMode = checkNotNull(shuffleMode);
}
 
Example 4
Source File: SplitTransformation.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new {@code SplitTransformation} from the given input and {@code OutputSelector}.
 *
 * @param input The input {@code Transformation}
 * @param outputSelector The output selector
 */
public SplitTransformation(
	Transformation<T> input,
		OutputSelector<T> outputSelector) {
	super("Split", input.getOutputType(), input.getParallelism());
	this.input = input;
	this.outputSelector = outputSelector;
}
 
Example 5
Source File: FeedbackTransformation.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Adds a feedback edge. The parallelism of the {@code Transformation} must match
 * the parallelism of the input {@code Transformation} of this
 * {@code FeedbackTransformation}
 *
 * @param transform The new feedback {@code Transformation}.
 */
public void addFeedbackEdge(Transformation<T> transform) {

	if (transform.getParallelism() != this.getParallelism()) {
		throw new UnsupportedOperationException(
				"Parallelism of the feedback stream must match the parallelism of the original" +
						" stream. Parallelism of original stream: " + this.getParallelism() +
						"; parallelism of feedback stream: " + transform.getParallelism() +
						". Parallelism can be modified using DataStream#setParallelism() method");
	}

	feedbackEdges.add(transform);
}
 
Example 6
Source File: CoFeedbackTransformation.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Adds a feedback edge. The parallelism of the {@code Transformation} must match
 * the parallelism of the input {@code Transformation} of the upstream
 * {@code Transformation}.
 *
 * @param transform The new feedback {@code Transformation}.
 */
public void addFeedbackEdge(Transformation<F> transform) {

	if (transform.getParallelism() != this.getParallelism()) {
		throw new UnsupportedOperationException(
				"Parallelism of the feedback stream must match the parallelism of the original" +
						" stream. Parallelism of original stream: " + this.getParallelism() +
						"; parallelism of feedback stream: " + transform.getParallelism());
	}

	feedbackEdges.add(transform);
}
 
Example 7
Source File: PartitionTransformation.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new {@code PartitionTransformation} from the given input and
 * {@link StreamPartitioner}.
 *
 * @param input The input {@code Transformation}
 * @param partitioner The {@code StreamPartitioner}
 * @param shuffleMode The {@code ShuffleMode}
 */
public PartitionTransformation(
		Transformation<T> input,
		StreamPartitioner<T> partitioner,
		ShuffleMode shuffleMode) {
	super("Partition", input.getOutputType(), input.getParallelism());
	this.input = input;
	this.partitioner = partitioner;
	this.shuffleMode = checkNotNull(shuffleMode);
}
 
Example 8
Source File: SplitTransformation.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new {@code SplitTransformation} from the given input and {@code OutputSelector}.
 *
 * @param input The input {@code Transformation}
 * @param outputSelector The output selector
 */
public SplitTransformation(
	Transformation<T> input,
		OutputSelector<T> outputSelector) {
	super("Split", input.getOutputType(), input.getParallelism());
	this.input = input;
	this.outputSelector = outputSelector;
}
 
Example 9
Source File: FeedbackTransformation.java    From flink with Apache License 2.0 3 votes vote down vote up
/**
 * Creates a new {@code FeedbackTransformation} from the given input.
 *
 * @param input The input {@code Transformation}
 * @param waitTime The wait time of the feedback operator. After the time expires
 *                          the operation will close and not receive any more feedback elements.
 */
public FeedbackTransformation(Transformation<T> input, Long waitTime) {
	super("Feedback", input.getOutputType(), input.getParallelism());
	this.input = input;
	this.waitTime = waitTime;
	this.feedbackEdges = Lists.newArrayList();
}
 
Example 10
Source File: SelectTransformation.java    From flink with Apache License 2.0 3 votes vote down vote up
/**
 * Creates a new {@code SelectionTransformation} from the given input that only selects
 * the streams with the selected names.
 *
 * @param input The input {@code Transformation}
 * @param selectedNames The names from the upstream {@code SplitTransformation} that this
 *                      {@code SelectTransformation} selects.
 */
public SelectTransformation(
	Transformation<T> input,
		List<String> selectedNames) {
	super("Select", input.getOutputType(), input.getParallelism());
	this.input = input;
	this.selectedNames = selectedNames;
}
 
Example 11
Source File: FeedbackTransformation.java    From flink with Apache License 2.0 3 votes vote down vote up
/**
 * Creates a new {@code FeedbackTransformation} from the given input.
 *
 * @param input The input {@code Transformation}
 * @param waitTime The wait time of the feedback operator. After the time expires
 *                          the operation will close and not receive any more feedback elements.
 */
public FeedbackTransformation(Transformation<T> input, Long waitTime) {
	super("Feedback", input.getOutputType(), input.getParallelism());
	this.input = input;
	this.waitTime = waitTime;
	this.feedbackEdges = Lists.newArrayList();
}
 
Example 12
Source File: SelectTransformation.java    From flink with Apache License 2.0 3 votes vote down vote up
/**
 * Creates a new {@code SelectionTransformation} from the given input that only selects
 * the streams with the selected names.
 *
 * @param input The input {@code Transformation}
 * @param selectedNames The names from the upstream {@code SplitTransformation} that this
 *                      {@code SelectTransformation} selects.
 */
public SelectTransformation(
	Transformation<T> input,
		List<String> selectedNames) {
	super("Select", input.getOutputType(), input.getParallelism());
	this.input = input;
	this.selectedNames = selectedNames;
}