public abstract class AbstractIterativeTask<S extends org.apache.flink.api.common.functions.Function,OT> extends BatchTask<S,OT> implements Terminable
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isSolutionSetUpdate |
protected boolean |
isWorksetIteration |
protected boolean |
isWorksetUpdate |
protected org.apache.flink.api.common.aggregators.LongSumAggregator |
worksetAggregator |
protected BlockingBackChannel |
worksetBackChannel |
accumulatorMap, broadcastInputReaders, broadcastInputSerializers, chainedTasks, config, driver, eventualOutputs, inputComparators, inputIterators, inputReaders, inputs, inputSerializers, iterativeBroadcastInputs, iterativeInputs, localStrategies, LOG, output, resettableInputs, running, runtimeUdfContext, stub, tempBarriers| Constructor and Description |
|---|
AbstractIterativeTask(Environment environment)
Create an Invokable task and set its environment.
|
| Modifier and Type | Method and Description |
|---|---|
String |
brokerKey() |
Future<Void> |
cancel()
This method is called when a task is canceled either as a result of a user abort or an
execution failure.
|
protected void |
closeLocalStrategiesAndCaches() |
DistributedRuntimeUDFContext |
createRuntimeContext(org.apache.flink.metrics.groups.OperatorMetricGroup metrics) |
protected org.apache.flink.util.Collector<OT> |
createSolutionSetUpdateOutputCollector(org.apache.flink.util.Collector<OT> delegate)
Creates a new solution set update output collector.
|
protected org.apache.flink.util.Collector<OT> |
createWorksetUpdateOutputCollector() |
protected org.apache.flink.util.Collector<OT> |
createWorksetUpdateOutputCollector(org.apache.flink.util.Collector<OT> delegate)
Creates a new
WorksetUpdateOutputCollector. |
protected int |
currentIteration() |
RuntimeAggregatorRegistry |
getIterationAggregators() |
protected void |
incrementIterationCounter() |
protected boolean |
inFirstIteration() |
protected void |
initialize() |
void |
requestTermination() |
void |
run() |
void |
terminationCompleted() |
boolean |
terminationRequested() |
protected void |
verifyEndOfSuperstepState() |
cancelChainedTasks, clearReaders, clearWriters, closeChainedTasks, closeUserCode, constructLogString, createInputIterator, excludeFromReset, formatLogString, getContainingTask, getDriverComparator, getInput, getInputSerializer, getIOManager, getLastOutputCollector, getLastTasksConfig, getMemoryManager, getMetricGroup, getNumTaskInputs, getOutputCollector, getOutputCollector, getStub, getTaskConfig, getTaskManagerInfo, initBroadcastInputReaders, initBroadcastInputsSerializers, initInputReaders, initInputsSerializersAndComparators, initLocalStrategies, initOutputs, initOutputs, initStub, instantiateUserCode, invoke, logAndThrowException, openChainedTasks, openUserCode, readAndSetBroadcastInput, releaseBroadcastVariables, resetAllInputs, setLastOutputCollectorabortCheckpointOnBarrier, cleanUp, dispatchOperatorEvent, getCurrentNumberOfSubtasks, getEnvironment, getExecutionConfig, getIndexInSubtaskGroup, getJobConfiguration, getTaskConfiguration, getUserCodeClassLoader, isUsingNonBlockingInput, maybeInterruptOnCancel, notifyCheckpointAbortAsync, notifyCheckpointCompleteAsync, restore, triggerCheckpointAsync, triggerCheckpointOnBarrierclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetExecutionConfig, getUserCodeClassLoaderprotected org.apache.flink.api.common.aggregators.LongSumAggregator worksetAggregator
protected BlockingBackChannel worksetBackChannel
protected boolean isWorksetIteration
protected boolean isWorksetUpdate
protected boolean isSolutionSetUpdate
public AbstractIterativeTask(Environment environment)
environment - The environment assigned to this invokable.protected void initialize()
throws Exception
initialize in class BatchTask<S extends org.apache.flink.api.common.functions.Function,OT>Exceptionpublic void run()
throws Exception
protected void closeLocalStrategiesAndCaches()
closeLocalStrategiesAndCaches in class BatchTask<S extends org.apache.flink.api.common.functions.Function,OT>public DistributedRuntimeUDFContext createRuntimeContext(org.apache.flink.metrics.groups.OperatorMetricGroup metrics)
createRuntimeContext in class BatchTask<S extends org.apache.flink.api.common.functions.Function,OT>protected boolean inFirstIteration()
protected int currentIteration()
protected void incrementIterationCounter()
public String brokerKey()
public RuntimeAggregatorRegistry getIterationAggregators()
protected void verifyEndOfSuperstepState()
throws IOException
IOExceptionpublic boolean terminationRequested()
terminationRequested in interface Terminablepublic void requestTermination()
requestTermination in interface Terminablepublic void terminationCompleted()
terminationCompleted in interface Terminablepublic Future<Void> cancel() throws Exception
TaskInvokablecancel in interface TaskInvokablecancel in class BatchTask<S extends org.apache.flink.api.common.functions.Function,OT>AbstractInvokable is fully terminated.
Note that it may never complete if the invokable is stuck.Exceptionprotected org.apache.flink.util.Collector<OT> createWorksetUpdateOutputCollector(org.apache.flink.util.Collector<OT> delegate)
WorksetUpdateOutputCollector.
This collector is used by IterationIntermediateTask or IterationTailTask
to update the workset.
If a non-null delegate is given, the new Collector will write to the solution set
and also call collect(T) of the delegate.
delegate - null -OR- the delegate on which to call collect() by the newly created
collectorWorksetUpdateOutputCollectorprotected org.apache.flink.util.Collector<OT> createWorksetUpdateOutputCollector()
protected org.apache.flink.util.Collector<OT> createSolutionSetUpdateOutputCollector(org.apache.flink.util.Collector<OT> delegate)
This collector is used by IterationIntermediateTask or IterationTailTask
to update the solution set of workset iterations. Depending on the task configuration, either
a fast (non-probing) SolutionSetFastUpdateOutputCollector or normal
(re-probing) SolutionSetUpdateOutputCollector is created.
If a non-null delegate is given, the new Collector will write back to the solution
set and also call collect(T) of the delegate.
delegate - null -OR- a delegate collector to be called by the newly created collectorSolutionSetFastUpdateOutputCollector or SolutionSetUpdateOutputCollectorCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.