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

The following examples show how to use org.apache.flink.api.java.typeutils.TypeExtractor#getGroupReduceReturnTypes() . 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 GroupReduce transformation on a grouped {@link DataSet}.
 *
 * <p>The transformation calls a {@link org.apache.flink.api.common.functions.RichGroupReduceFunction} for each group of the DataSet.
 * A GroupReduceFunction can iterate over all elements of a group and emit any
 *   number of output elements including none.
 *
 * @param reducer The GroupReduceFunction that is applied on each group of the DataSet.
 * @return A GroupReduceOperator that represents the reduced DataSet.
 *
 * @see org.apache.flink.api.common.functions.RichGroupReduceFunction
 * @see GroupReduceOperator
 * @see DataSet
 */
public <R> GroupReduceOperator<T, R> reduceGroup(GroupReduceFunction<T, R> reducer) {
	if (reducer == null) {
		throw new NullPointerException("GroupReduce function must not be null.");
	}
	TypeInformation<R> resultType = TypeExtractor.getGroupReduceReturnTypes(reducer,
			this.getInputDataSet().getType(), Utils.getCallLocationName(), true);

	return new GroupReduceOperator<T, R>(this, resultType, inputDataSet.clean(reducer), Utils.getCallLocationName());
}
 
Example 2
Source File: SortedGrouping.java    From Flink-CEPplus with Apache License 2.0 3 votes vote down vote up
/**
 * Applies a GroupReduce transformation on a grouped and sorted {@link DataSet}.
 *
 * <p>The transformation calls a {@link org.apache.flink.api.common.functions.RichGroupReduceFunction} for each group of the DataSet.
 * A GroupReduceFunction can iterate over all elements of a group and emit any
 *   number of output elements including none.
 *
 * @param reducer The GroupReduceFunction that is applied on each group of the DataSet.
 * @return A GroupReduceOperator that represents the reduced DataSet.
 *
 * @see org.apache.flink.api.common.functions.RichGroupReduceFunction
 * @see GroupReduceOperator
 * @see DataSet
 */
public <R> GroupReduceOperator<T, R> reduceGroup(GroupReduceFunction<T, R> reducer) {
	if (reducer == null) {
		throw new NullPointerException("GroupReduce function must not be null.");
	}
	TypeInformation<R> resultType = TypeExtractor.getGroupReduceReturnTypes(reducer,
			inputDataSet.getType(), Utils.getCallLocationName(), true);
	return new GroupReduceOperator<>(this, resultType, inputDataSet.clean(reducer), Utils.getCallLocationName());
}
 
Example 3
Source File: DataSet.java    From Flink-CEPplus with Apache License 2.0 3 votes vote down vote up
/**
 * Applies a GroupReduce transformation on a non-grouped {@link DataSet}.
 *
 * <p>The transformation calls a {@link org.apache.flink.api.common.functions.RichGroupReduceFunction} once with the full DataSet.
 * The GroupReduceFunction can iterate over all elements of the DataSet and emit any
 *   number of output elements including none.
 *
 * @param reducer The GroupReduceFunction that is applied on the DataSet.
 * @return A GroupReduceOperator that represents the reduced DataSet.
 *
 * @see org.apache.flink.api.common.functions.RichGroupReduceFunction
 * @see org.apache.flink.api.java.operators.GroupReduceOperator
 * @see DataSet
 */
public <R> GroupReduceOperator<T, R> reduceGroup(GroupReduceFunction<T, R> reducer) {
	if (reducer == null) {
		throw new NullPointerException("GroupReduce function must not be null.");
	}

	String callLocation = Utils.getCallLocationName();
	TypeInformation<R> resultType = TypeExtractor.getGroupReduceReturnTypes(reducer, getType(), callLocation, true);
	return new GroupReduceOperator<>(this, resultType, clean(reducer), callLocation);
}
 
Example 4
Source File: UnsortedGrouping.java    From flink with Apache License 2.0 3 votes vote down vote up
/**
 * Applies a GroupReduce transformation on a grouped {@link DataSet}.
 *
 * <p>The transformation calls a {@link org.apache.flink.api.common.functions.RichGroupReduceFunction} for each group of the DataSet.
 * A GroupReduceFunction can iterate over all elements of a group and emit any
 *   number of output elements including none.
 *
 * @param reducer The GroupReduceFunction that is applied on each group of the DataSet.
 * @return A GroupReduceOperator that represents the reduced DataSet.
 *
 * @see org.apache.flink.api.common.functions.RichGroupReduceFunction
 * @see GroupReduceOperator
 * @see DataSet
 */
public <R> GroupReduceOperator<T, R> reduceGroup(GroupReduceFunction<T, R> reducer) {
	if (reducer == null) {
		throw new NullPointerException("GroupReduce function must not be null.");
	}
	TypeInformation<R> resultType = TypeExtractor.getGroupReduceReturnTypes(reducer,
			this.getInputDataSet().getType(), Utils.getCallLocationName(), true);

	return new GroupReduceOperator<T, R>(this, resultType, inputDataSet.clean(reducer), Utils.getCallLocationName());
}
 
Example 5
Source File: SortedGrouping.java    From flink with Apache License 2.0 3 votes vote down vote up
/**
 * Applies a GroupReduce transformation on a grouped and sorted {@link DataSet}.
 *
 * <p>The transformation calls a {@link org.apache.flink.api.common.functions.RichGroupReduceFunction} for each group of the DataSet.
 * A GroupReduceFunction can iterate over all elements of a group and emit any
 *   number of output elements including none.
 *
 * @param reducer The GroupReduceFunction that is applied on each group of the DataSet.
 * @return A GroupReduceOperator that represents the reduced DataSet.
 *
 * @see org.apache.flink.api.common.functions.RichGroupReduceFunction
 * @see GroupReduceOperator
 * @see DataSet
 */
public <R> GroupReduceOperator<T, R> reduceGroup(GroupReduceFunction<T, R> reducer) {
	if (reducer == null) {
		throw new NullPointerException("GroupReduce function must not be null.");
	}
	TypeInformation<R> resultType = TypeExtractor.getGroupReduceReturnTypes(reducer,
			inputDataSet.getType(), Utils.getCallLocationName(), true);
	return new GroupReduceOperator<>(this, resultType, inputDataSet.clean(reducer), Utils.getCallLocationName());
}
 
Example 6
Source File: DataSet.java    From flink with Apache License 2.0 3 votes vote down vote up
/**
 * Applies a GroupReduce transformation on a non-grouped {@link DataSet}.
 *
 * <p>The transformation calls a {@link org.apache.flink.api.common.functions.RichGroupReduceFunction} once with the full DataSet.
 * The GroupReduceFunction can iterate over all elements of the DataSet and emit any
 *   number of output elements including none.
 *
 * @param reducer The GroupReduceFunction that is applied on the DataSet.
 * @return A GroupReduceOperator that represents the reduced DataSet.
 *
 * @see org.apache.flink.api.common.functions.RichGroupReduceFunction
 * @see org.apache.flink.api.java.operators.GroupReduceOperator
 * @see DataSet
 */
public <R> GroupReduceOperator<T, R> reduceGroup(GroupReduceFunction<T, R> reducer) {
	if (reducer == null) {
		throw new NullPointerException("GroupReduce function must not be null.");
	}

	String callLocation = Utils.getCallLocationName();
	TypeInformation<R> resultType = TypeExtractor.getGroupReduceReturnTypes(reducer, getType(), callLocation, true);
	return new GroupReduceOperator<>(this, resultType, clean(reducer), callLocation);
}
 
Example 7
Source File: UnsortedGrouping.java    From flink with Apache License 2.0 3 votes vote down vote up
/**
 * Applies a GroupReduce transformation on a grouped {@link DataSet}.
 *
 * <p>The transformation calls a {@link org.apache.flink.api.common.functions.RichGroupReduceFunction} for each group of the DataSet.
 * A GroupReduceFunction can iterate over all elements of a group and emit any
 *   number of output elements including none.
 *
 * @param reducer The GroupReduceFunction that is applied on each group of the DataSet.
 * @return A GroupReduceOperator that represents the reduced DataSet.
 *
 * @see org.apache.flink.api.common.functions.RichGroupReduceFunction
 * @see GroupReduceOperator
 * @see DataSet
 */
public <R> GroupReduceOperator<T, R> reduceGroup(GroupReduceFunction<T, R> reducer) {
	if (reducer == null) {
		throw new NullPointerException("GroupReduce function must not be null.");
	}
	TypeInformation<R> resultType = TypeExtractor.getGroupReduceReturnTypes(reducer,
			this.getInputDataSet().getType(), Utils.getCallLocationName(), true);

	return new GroupReduceOperator<T, R>(this, resultType, inputDataSet.clean(reducer), Utils.getCallLocationName());
}
 
Example 8
Source File: SortedGrouping.java    From flink with Apache License 2.0 3 votes vote down vote up
/**
 * Applies a GroupReduce transformation on a grouped and sorted {@link DataSet}.
 *
 * <p>The transformation calls a {@link org.apache.flink.api.common.functions.RichGroupReduceFunction} for each group of the DataSet.
 * A GroupReduceFunction can iterate over all elements of a group and emit any
 *   number of output elements including none.
 *
 * @param reducer The GroupReduceFunction that is applied on each group of the DataSet.
 * @return A GroupReduceOperator that represents the reduced DataSet.
 *
 * @see org.apache.flink.api.common.functions.RichGroupReduceFunction
 * @see GroupReduceOperator
 * @see DataSet
 */
public <R> GroupReduceOperator<T, R> reduceGroup(GroupReduceFunction<T, R> reducer) {
	if (reducer == null) {
		throw new NullPointerException("GroupReduce function must not be null.");
	}
	TypeInformation<R> resultType = TypeExtractor.getGroupReduceReturnTypes(reducer,
			inputDataSet.getType(), Utils.getCallLocationName(), true);
	return new GroupReduceOperator<>(this, resultType, inputDataSet.clean(reducer), Utils.getCallLocationName());
}
 
Example 9
Source File: DataSet.java    From flink with Apache License 2.0 3 votes vote down vote up
/**
 * Applies a GroupReduce transformation on a non-grouped {@link DataSet}.
 *
 * <p>The transformation calls a {@link org.apache.flink.api.common.functions.RichGroupReduceFunction} once with the full DataSet.
 * The GroupReduceFunction can iterate over all elements of the DataSet and emit any
 *   number of output elements including none.
 *
 * @param reducer The GroupReduceFunction that is applied on the DataSet.
 * @return A GroupReduceOperator that represents the reduced DataSet.
 *
 * @see org.apache.flink.api.common.functions.RichGroupReduceFunction
 * @see org.apache.flink.api.java.operators.GroupReduceOperator
 * @see DataSet
 */
public <R> GroupReduceOperator<T, R> reduceGroup(GroupReduceFunction<T, R> reducer) {
	if (reducer == null) {
		throw new NullPointerException("GroupReduce function must not be null.");
	}

	String callLocation = Utils.getCallLocationName();
	TypeInformation<R> resultType = TypeExtractor.getGroupReduceReturnTypes(reducer, getType(), callLocation, true);
	return new GroupReduceOperator<>(this, resultType, clean(reducer), callLocation);
}