Search in sources :

Example 1 with WorksetUpdateOutputCollector

use of org.apache.flink.runtime.iterative.io.WorksetUpdateOutputCollector in project flink by apache.

the class AbstractIterativeTask method createWorksetUpdateOutputCollector.

// -----------------------------------------------------------------------------------------------------------------
// Iteration State Update Handling
// -----------------------------------------------------------------------------------------------------------------
/**
	 * Creates a new {@link WorksetUpdateOutputCollector}.
	 * <p>
	 * This collector is used by {@link IterationIntermediateTask} or {@link IterationTailTask} to update the
	 * workset.
	 * <p>
	 * If a non-null delegate is given, the new {@link Collector} will write to the solution set and also call
	 * collect(T) of the delegate.
	 *
	 * @param delegate null -OR- the delegate on which to call collect() by the newly created collector
	 * @return a new {@link WorksetUpdateOutputCollector}
	 */
protected Collector<OT> createWorksetUpdateOutputCollector(Collector<OT> delegate) {
    DataOutputView outputView = worksetBackChannel.getWriteEnd();
    TypeSerializer<OT> serializer = getOutputSerializer();
    return new WorksetUpdateOutputCollector<OT>(outputView, serializer, delegate);
}
Also used : WorksetUpdateOutputCollector(org.apache.flink.runtime.iterative.io.WorksetUpdateOutputCollector) DataOutputView(org.apache.flink.core.memory.DataOutputView)

Aggregations

DataOutputView (org.apache.flink.core.memory.DataOutputView)1 WorksetUpdateOutputCollector (org.apache.flink.runtime.iterative.io.WorksetUpdateOutputCollector)1