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

The following examples show how to use org.apache.flink.api.java.typeutils.TypeExtractor#getGroupCombineReturnTypes() . 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: UnsortedGrouping.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Applies a GroupCombineFunction on a grouped {@link DataSet}.
 * A GroupCombineFunction is similar to a GroupReduceFunction but does not perform a full data exchange. Instead, the
 * CombineFunction calls the combine method once per partition for combining a group of results. This
 * operator is suitable for combining values into an intermediate format before doing a proper groupReduce where
 * the data is shuffled across the node for further reduction. The GroupReduce operator can also be supplied with
 * a combiner by implementing the RichGroupReduce function. The combine method of the RichGroupReduce function
 * demands input and output type to be the same. The CombineFunction, on the other side, can have an arbitrary
 * output type.
 * @param combiner The GroupCombineFunction that is applied on the DataSet.
 * @return A GroupCombineOperator which represents the combined DataSet.
 */
public <R> GroupCombineOperator<T, R> combineGroup(GroupCombineFunction<T, R> combiner) {
	if (combiner == null) {
		throw new NullPointerException("GroupCombine function must not be null.");
	}
	TypeInformation<R> resultType = TypeExtractor.getGroupCombineReturnTypes(combiner,
			this.getInputDataSet().getType(), Utils.getCallLocationName(), true);

	return new GroupCombineOperator<T, R>(this, resultType, inputDataSet.clean(combiner), Utils.getCallLocationName());
}
 
Example 2
Source Project: Flink-CEPplus   File: SortedGrouping.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Applies a GroupCombineFunction on a grouped {@link DataSet}.
 * A CombineFunction is similar to a GroupReduceFunction but does not perform a full data exchange. Instead, the
 * CombineFunction calls the combine method once per partition for combining a group of results. This
 * operator is suitable for combining values into an intermediate format before doing a proper groupReduce where
 * the data is shuffled across the node for further reduction. The GroupReduce operator can also be supplied with
 * a combiner by implementing the RichGroupReduce function. The combine method of the RichGroupReduce function
 * demands input and output type to be the same. The CombineFunction, on the other side, can have an arbitrary
 * output type.
 * @param combiner The GroupCombineFunction that is applied on the DataSet.
 * @return A GroupCombineOperator which represents the combined DataSet.
 */
public <R> GroupCombineOperator<T, R> combineGroup(GroupCombineFunction<T, R> combiner) {
	if (combiner == null) {
		throw new NullPointerException("GroupCombine function must not be null.");
	}
	TypeInformation<R> resultType = TypeExtractor.getGroupCombineReturnTypes(combiner,
			this.getInputDataSet().getType(), Utils.getCallLocationName(), true);

	return new GroupCombineOperator<>(this, resultType, inputDataSet.clean(combiner), Utils.getCallLocationName());
}
 
Example 3
Source Project: Flink-CEPplus   File: DataSet.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Applies a GroupCombineFunction on a non-grouped {@link DataSet}.
 * A CombineFunction is similar to a GroupReduceFunction but does not perform a full data exchange. Instead, the
 * CombineFunction calls the combine method once per partition for combining a group of results. This
 * operator is suitable for combining values into an intermediate format before doing a proper groupReduce where
 * the data is shuffled across the node for further reduction. The GroupReduce operator can also be supplied with
 * a combiner by implementing the RichGroupReduce function. The combine method of the RichGroupReduce function
 * demands input and output type to be the same. The CombineFunction, on the other side, can have an arbitrary
 * output type.
 * @param combiner The GroupCombineFunction that is applied on the DataSet.
 * @return A GroupCombineOperator which represents the combined DataSet.
 */
public <R> GroupCombineOperator<T, R> combineGroup(GroupCombineFunction<T, R> combiner) {
	if (combiner == null) {
		throw new NullPointerException("GroupCombine function must not be null.");
	}

	String callLocation = Utils.getCallLocationName();
	TypeInformation<R> resultType = TypeExtractor.getGroupCombineReturnTypes(combiner, getType(), callLocation, true);
	return new GroupCombineOperator<>(this, resultType, clean(combiner), callLocation);
}
 
Example 4
Source Project: flink   File: UnsortedGrouping.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Applies a GroupCombineFunction on a grouped {@link DataSet}.
 * A GroupCombineFunction is similar to a GroupReduceFunction but does not perform a full data exchange. Instead, the
 * CombineFunction calls the combine method once per partition for combining a group of results. This
 * operator is suitable for combining values into an intermediate format before doing a proper groupReduce where
 * the data is shuffled across the node for further reduction. The GroupReduce operator can also be supplied with
 * a combiner by implementing the RichGroupReduce function. The combine method of the RichGroupReduce function
 * demands input and output type to be the same. The CombineFunction, on the other side, can have an arbitrary
 * output type.
 * @param combiner The GroupCombineFunction that is applied on the DataSet.
 * @return A GroupCombineOperator which represents the combined DataSet.
 */
public <R> GroupCombineOperator<T, R> combineGroup(GroupCombineFunction<T, R> combiner) {
	if (combiner == null) {
		throw new NullPointerException("GroupCombine function must not be null.");
	}
	TypeInformation<R> resultType = TypeExtractor.getGroupCombineReturnTypes(combiner,
			this.getInputDataSet().getType(), Utils.getCallLocationName(), true);

	return new GroupCombineOperator<T, R>(this, resultType, inputDataSet.clean(combiner), Utils.getCallLocationName());
}
 
Example 5
Source Project: flink   File: SortedGrouping.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Applies a GroupCombineFunction on a grouped {@link DataSet}.
 * A CombineFunction is similar to a GroupReduceFunction but does not perform a full data exchange. Instead, the
 * CombineFunction calls the combine method once per partition for combining a group of results. This
 * operator is suitable for combining values into an intermediate format before doing a proper groupReduce where
 * the data is shuffled across the node for further reduction. The GroupReduce operator can also be supplied with
 * a combiner by implementing the RichGroupReduce function. The combine method of the RichGroupReduce function
 * demands input and output type to be the same. The CombineFunction, on the other side, can have an arbitrary
 * output type.
 * @param combiner The GroupCombineFunction that is applied on the DataSet.
 * @return A GroupCombineOperator which represents the combined DataSet.
 */
public <R> GroupCombineOperator<T, R> combineGroup(GroupCombineFunction<T, R> combiner) {
	if (combiner == null) {
		throw new NullPointerException("GroupCombine function must not be null.");
	}
	TypeInformation<R> resultType = TypeExtractor.getGroupCombineReturnTypes(combiner,
			this.getInputDataSet().getType(), Utils.getCallLocationName(), true);

	return new GroupCombineOperator<>(this, resultType, inputDataSet.clean(combiner), Utils.getCallLocationName());
}
 
Example 6
Source Project: flink   File: DataSet.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Applies a GroupCombineFunction on a non-grouped {@link DataSet}.
 * A CombineFunction is similar to a GroupReduceFunction but does not perform a full data exchange. Instead, the
 * CombineFunction calls the combine method once per partition for combining a group of results. This
 * operator is suitable for combining values into an intermediate format before doing a proper groupReduce where
 * the data is shuffled across the node for further reduction. The GroupReduce operator can also be supplied with
 * a combiner by implementing the RichGroupReduce function. The combine method of the RichGroupReduce function
 * demands input and output type to be the same. The CombineFunction, on the other side, can have an arbitrary
 * output type.
 * @param combiner The GroupCombineFunction that is applied on the DataSet.
 * @return A GroupCombineOperator which represents the combined DataSet.
 */
public <R> GroupCombineOperator<T, R> combineGroup(GroupCombineFunction<T, R> combiner) {
	if (combiner == null) {
		throw new NullPointerException("GroupCombine function must not be null.");
	}

	String callLocation = Utils.getCallLocationName();
	TypeInformation<R> resultType = TypeExtractor.getGroupCombineReturnTypes(combiner, getType(), callLocation, true);
	return new GroupCombineOperator<>(this, resultType, clean(combiner), callLocation);
}
 
Example 7
Source Project: flink   File: UnsortedGrouping.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Applies a GroupCombineFunction on a grouped {@link DataSet}.
 * A GroupCombineFunction is similar to a GroupReduceFunction but does not perform a full data exchange. Instead, the
 * CombineFunction calls the combine method once per partition for combining a group of results. This
 * operator is suitable for combining values into an intermediate format before doing a proper groupReduce where
 * the data is shuffled across the node for further reduction. The GroupReduce operator can also be supplied with
 * a combiner by implementing the RichGroupReduce function. The combine method of the RichGroupReduce function
 * demands input and output type to be the same. The CombineFunction, on the other side, can have an arbitrary
 * output type.
 * @param combiner The GroupCombineFunction that is applied on the DataSet.
 * @return A GroupCombineOperator which represents the combined DataSet.
 */
public <R> GroupCombineOperator<T, R> combineGroup(GroupCombineFunction<T, R> combiner) {
	if (combiner == null) {
		throw new NullPointerException("GroupCombine function must not be null.");
	}
	TypeInformation<R> resultType = TypeExtractor.getGroupCombineReturnTypes(combiner,
			this.getInputDataSet().getType(), Utils.getCallLocationName(), true);

	return new GroupCombineOperator<T, R>(this, resultType, inputDataSet.clean(combiner), Utils.getCallLocationName());
}
 
Example 8
Source Project: flink   File: SortedGrouping.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Applies a GroupCombineFunction on a grouped {@link DataSet}.
 * A CombineFunction is similar to a GroupReduceFunction but does not perform a full data exchange. Instead, the
 * CombineFunction calls the combine method once per partition for combining a group of results. This
 * operator is suitable for combining values into an intermediate format before doing a proper groupReduce where
 * the data is shuffled across the node for further reduction. The GroupReduce operator can also be supplied with
 * a combiner by implementing the RichGroupReduce function. The combine method of the RichGroupReduce function
 * demands input and output type to be the same. The CombineFunction, on the other side, can have an arbitrary
 * output type.
 * @param combiner The GroupCombineFunction that is applied on the DataSet.
 * @return A GroupCombineOperator which represents the combined DataSet.
 */
public <R> GroupCombineOperator<T, R> combineGroup(GroupCombineFunction<T, R> combiner) {
	if (combiner == null) {
		throw new NullPointerException("GroupCombine function must not be null.");
	}
	TypeInformation<R> resultType = TypeExtractor.getGroupCombineReturnTypes(combiner,
			this.getInputDataSet().getType(), Utils.getCallLocationName(), true);

	return new GroupCombineOperator<>(this, resultType, inputDataSet.clean(combiner), Utils.getCallLocationName());
}
 
Example 9
Source Project: flink   File: DataSet.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Applies a GroupCombineFunction on a non-grouped {@link DataSet}.
 * A CombineFunction is similar to a GroupReduceFunction but does not perform a full data exchange. Instead, the
 * CombineFunction calls the combine method once per partition for combining a group of results. This
 * operator is suitable for combining values into an intermediate format before doing a proper groupReduce where
 * the data is shuffled across the node for further reduction. The GroupReduce operator can also be supplied with
 * a combiner by implementing the RichGroupReduce function. The combine method of the RichGroupReduce function
 * demands input and output type to be the same. The CombineFunction, on the other side, can have an arbitrary
 * output type.
 * @param combiner The GroupCombineFunction that is applied on the DataSet.
 * @return A GroupCombineOperator which represents the combined DataSet.
 */
public <R> GroupCombineOperator<T, R> combineGroup(GroupCombineFunction<T, R> combiner) {
	if (combiner == null) {
		throw new NullPointerException("GroupCombine function must not be null.");
	}

	String callLocation = Utils.getCallLocationName();
	TypeInformation<R> resultType = TypeExtractor.getGroupCombineReturnTypes(combiner, getType(), callLocation, true);
	return new GroupCombineOperator<>(this, resultType, clean(combiner), callLocation);
}