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 File: UnsortedGrouping.java    From Flink-CEPplus with 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 File: SortedGrouping.java    From Flink-CEPplus with 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 File: DataSet.java    From Flink-CEPplus with 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 File: UnsortedGrouping.java    From flink with 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 File: SortedGrouping.java    From flink with 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 File: DataSet.java    From flink with 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 File: UnsortedGrouping.java    From flink with 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 File: SortedGrouping.java    From flink with 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 File: DataSet.java    From flink with 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);
}