Java Code Examples for org.apache.flink.api.java.typeutils.TypeExtractor#getCoGroupReturnTypes()

The following examples show how to use org.apache.flink.api.java.typeutils.TypeExtractor#getCoGroupReturnTypes() . 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 Project: Flink-CEPplus   File: CoGroupOperator.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Finalizes a CoGroup transformation by applying a {@link org.apache.flink.api.common.functions.RichCoGroupFunction} to groups of elements with identical keys.
 *
 * <p>Each CoGroupFunction call returns an arbitrary number of keys.
 *
 * @param function The CoGroupFunction that is called for all groups of elements with identical keys.
 * @return An CoGroupOperator that represents the co-grouped result DataSet.
 *
 * @see org.apache.flink.api.common.functions.RichCoGroupFunction
 * @see DataSet
 */
public <R> CoGroupOperator<I1, I2, R> with(CoGroupFunction<I1, I2, R> function) {
	if (function == null) {
		throw new NullPointerException("CoGroup function must not be null.");
	}
	TypeInformation<R> returnType = TypeExtractor.getCoGroupReturnTypes(function, input1.getType(), input2.getType(),
			Utils.getCallLocationName(), true);

	return new CoGroupOperator<>(input1, input2, keys1, keys2, input1.clean(function), returnType,
			groupSortKeyOrderFirst, groupSortKeyOrderSecond,
			customPartitioner, Utils.getCallLocationName());
}
 
Example 2
Source Project: Flink-CEPplus   File: CoGroupedStreams.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Completes the co-group operation with the user function that is executed
 * for windowed groups.
 *
 * <p>Note: This method's return type does not support setting an operator-specific parallelism.
 * Due to binary backwards compatibility, this cannot be altered. Use the {@link #with(CoGroupFunction)}
 * method to set an operator-specific parallelism.
 */
public <T> DataStream<T> apply(CoGroupFunction<T1, T2, T> function) {

	TypeInformation<T> resultType = TypeExtractor.getCoGroupReturnTypes(
		function,
		input1.getType(),
		input2.getType(),
		"CoGroup",
		false);

	return apply(function, resultType);
}
 
Example 3
Source Project: flink   File: CoGroupOperator.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Finalizes a CoGroup transformation by applying a {@link org.apache.flink.api.common.functions.RichCoGroupFunction} to groups of elements with identical keys.
 *
 * <p>Each CoGroupFunction call returns an arbitrary number of keys.
 *
 * @param function The CoGroupFunction that is called for all groups of elements with identical keys.
 * @return An CoGroupOperator that represents the co-grouped result DataSet.
 *
 * @see org.apache.flink.api.common.functions.RichCoGroupFunction
 * @see DataSet
 */
public <R> CoGroupOperator<I1, I2, R> with(CoGroupFunction<I1, I2, R> function) {
	if (function == null) {
		throw new NullPointerException("CoGroup function must not be null.");
	}
	TypeInformation<R> returnType = TypeExtractor.getCoGroupReturnTypes(function, input1.getType(), input2.getType(),
			Utils.getCallLocationName(), true);

	return new CoGroupOperator<>(input1, input2, keys1, keys2, input1.clean(function), returnType,
			groupSortKeyOrderFirst, groupSortKeyOrderSecond,
			customPartitioner, Utils.getCallLocationName());
}
 
Example 4
Source Project: flink   File: CoGroupedStreams.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Completes the co-group operation with the user function that is executed
 * for windowed groups.
 *
 * <p>Note: This method's return type does not support setting an operator-specific parallelism.
 * Due to binary backwards compatibility, this cannot be altered. Use the {@link #with(CoGroupFunction)}
 * method to set an operator-specific parallelism.
 */
public <T> DataStream<T> apply(CoGroupFunction<T1, T2, T> function) {

	TypeInformation<T> resultType = TypeExtractor.getCoGroupReturnTypes(
		function,
		input1.getType(),
		input2.getType(),
		"CoGroup",
		false);

	return apply(function, resultType);
}
 
Example 5
Source Project: flink   File: CoGroupOperator.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Finalizes a CoGroup transformation by applying a {@link org.apache.flink.api.common.functions.RichCoGroupFunction} to groups of elements with identical keys.
 *
 * <p>Each CoGroupFunction call returns an arbitrary number of keys.
 *
 * @param function The CoGroupFunction that is called for all groups of elements with identical keys.
 * @return An CoGroupOperator that represents the co-grouped result DataSet.
 *
 * @see org.apache.flink.api.common.functions.RichCoGroupFunction
 * @see DataSet
 */
public <R> CoGroupOperator<I1, I2, R> with(CoGroupFunction<I1, I2, R> function) {
	if (function == null) {
		throw new NullPointerException("CoGroup function must not be null.");
	}
	TypeInformation<R> returnType = TypeExtractor.getCoGroupReturnTypes(function, input1.getType(), input2.getType(),
			Utils.getCallLocationName(), true);

	return new CoGroupOperator<>(input1, input2, keys1, keys2, input1.clean(function), returnType,
			groupSortKeyOrderFirst, groupSortKeyOrderSecond,
			customPartitioner, Utils.getCallLocationName());
}
 
Example 6
Source Project: flink   File: CoGroupedStreams.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Completes the co-group operation with the user function that is executed
 * for windowed groups.
 *
 * <p>Note: This method's return type does not support setting an operator-specific parallelism.
 * Due to binary backwards compatibility, this cannot be altered. Use the {@link #with(CoGroupFunction)}
 * method to set an operator-specific parallelism.
 */
public <T> DataStream<T> apply(CoGroupFunction<T1, T2, T> function) {

	TypeInformation<T> resultType = TypeExtractor.getCoGroupReturnTypes(
		function,
		input1.getType(),
		input2.getType(),
		"CoGroup",
		false);

	return apply(function, resultType);
}