org.apache.flink.streaming.api.transformations.SplitTransformation Java Examples

The following examples show how to use org.apache.flink.streaming.api.transformations.SplitTransformation. 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: StreamGraphGenerator.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
/**
 * Transforms a {@code SplitTransformation}.
 *
 * <p>We add the output selector to previously transformed nodes.
 */
private <T> Collection<Integer> transformSplit(SplitTransformation<T> split) {

	StreamTransformation<T> input = split.getInput();
	Collection<Integer> resultIds = transform(input);

	validateSplitTransformation(input);

	// the recursive transform call might have transformed this already
	if (alreadyTransformed.containsKey(split)) {
		return alreadyTransformed.get(split);
	}

	for (int inputId : resultIds) {
		streamGraph.addOutputSelector(inputId, split.getOutputSelector());
	}

	return resultIds;
}
 
Example #2
Source File: StreamGraphGenerator.java    From flink with Apache License 2.0 6 votes vote down vote up
/**
 * Transforms a {@code SplitTransformation}.
 *
 * <p>We add the output selector to previously transformed nodes.
 */
private <T> Collection<Integer> transformSplit(SplitTransformation<T> split) {

	Transformation<T> input = split.getInput();
	Collection<Integer> resultIds = transform(input);

	validateSplitTransformation(input);

	// the recursive transform call might have transformed this already
	if (alreadyTransformed.containsKey(split)) {
		return alreadyTransformed.get(split);
	}

	for (int inputId : resultIds) {
		streamGraph.addOutputSelector(inputId, split.getOutputSelector());
	}

	return resultIds;
}
 
Example #3
Source File: StreamGraphGenerator.java    From flink with Apache License 2.0 6 votes vote down vote up
/**
 * Transforms a {@code SplitTransformation}.
 *
 * <p>We add the output selector to previously transformed nodes.
 */
private <T> Collection<Integer> transformSplit(SplitTransformation<T> split) {

	Transformation<T> input = split.getInput();
	Collection<Integer> resultIds = transform(input);

	validateSplitTransformation(input);

	// the recursive transform call might have transformed this already
	if (alreadyTransformed.containsKey(split)) {
		return alreadyTransformed.get(split);
	}

	for (int inputId : resultIds) {
		streamGraph.addOutputSelector(inputId, split.getOutputSelector());
	}

	return resultIds;
}
 
Example #4
Source File: StreamGraphGenerator.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private <T> void validateSplitTransformation(StreamTransformation<T> input) {
	if (input instanceof SelectTransformation || input instanceof SplitTransformation) {
		throw new IllegalStateException("Consecutive multiple splits are not supported. Splits are deprecated. Please use side-outputs.");
	} else if (input instanceof SideOutputTransformation) {
		throw new IllegalStateException("Split after side-outputs are not supported. Splits are deprecated. Please use side-outputs.");
	} else if (input instanceof UnionTransformation) {
		for (StreamTransformation<T> transformation : ((UnionTransformation<T>) input).getInputs()) {
			validateSplitTransformation(transformation);
		}
	} else if (input instanceof PartitionTransformation) {
		validateSplitTransformation(((PartitionTransformation) input).getInput());
	} else {
		return;
	}
}
 
Example #5
Source File: StreamGraphGenerator.java    From flink with Apache License 2.0 5 votes vote down vote up
private <T> void validateSplitTransformation(Transformation<T> input) {
	if (input instanceof SelectTransformation || input instanceof SplitTransformation) {
		throw new IllegalStateException("Consecutive multiple splits are not supported. Splits are deprecated. Please use side-outputs.");
	} else if (input instanceof SideOutputTransformation) {
		throw new IllegalStateException("Split after side-outputs are not supported. Splits are deprecated. Please use side-outputs.");
	} else if (input instanceof UnionTransformation) {
		for (Transformation<T> transformation : ((UnionTransformation<T>) input).getInputs()) {
			validateSplitTransformation(transformation);
		}
	} else if (input instanceof PartitionTransformation) {
		validateSplitTransformation(((PartitionTransformation) input).getInput());
	} else {
		return;
	}
}
 
Example #6
Source File: StreamGraphGenerator.java    From flink with Apache License 2.0 5 votes vote down vote up
private <T> void validateSplitTransformation(Transformation<T> input) {
	if (input instanceof SelectTransformation || input instanceof SplitTransformation) {
		throw new IllegalStateException("Consecutive multiple splits are not supported. Splits are deprecated. Please use side-outputs.");
	} else if (input instanceof SideOutputTransformation) {
		throw new IllegalStateException("Split after side-outputs are not supported. Splits are deprecated. Please use side-outputs.");
	} else if (input instanceof UnionTransformation) {
		for (Transformation<T> transformation : ((UnionTransformation<T>) input).getInputs()) {
			validateSplitTransformation(transformation);
		}
	} else if (input instanceof PartitionTransformation) {
		validateSplitTransformation(((PartitionTransformation) input).getInput());
	} else {
		return;
	}
}
 
Example #7
Source File: SplitStream.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
protected SplitStream(DataStream<OUT> dataStream, OutputSelector<OUT> outputSelector) {
	super(dataStream.getExecutionEnvironment(), new SplitTransformation<OUT>(dataStream.getTransformation(), outputSelector));
}
 
Example #8
Source File: SplitStream.java    From flink with Apache License 2.0 4 votes vote down vote up
protected SplitStream(DataStream<OUT> dataStream, OutputSelector<OUT> outputSelector) {
	super(dataStream.getExecutionEnvironment(), new SplitTransformation<OUT>(dataStream.getTransformation(), outputSelector));
}
 
Example #9
Source File: SplitStream.java    From flink with Apache License 2.0 4 votes vote down vote up
protected SplitStream(DataStream<OUT> dataStream, OutputSelector<OUT> outputSelector) {
	super(dataStream.getExecutionEnvironment(), new SplitTransformation<OUT>(dataStream.getTransformation(), outputSelector));
}