OUT- The type of the records produced by this source.
@Public public abstract class RichSourceFunction<OUT> extends AbstractRichFunction implements SourceFunction<OUT>
AbstractRichFunction.getRuntimeContext()) and additional life-cycle methods (
This class is useful when implementing parallel sources where different parallel subtasks need to perform different work. Typical patterns for that are:
AbstractRichFunction.getRuntimeContext()to obtain the runtime context.
RuntimeContext.getNumberOfParallelSubtasks()to determine the current parallelism. It is strongly encouraged to use this method, rather than hard-wiring the parallelism, because the configured parallelism may change depending on program configuration. The parallelism may also change after recovering failures, when fewer than desired parallel worker as available.
RuntimeContext.getIndexOfThisSubtask()to determine which subtask the current instance of the function executes.
|Constructor and Description|
close, getIterationRuntimeContext, getRuntimeContext, open, setRuntimeContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.