X
- The type of the bulk partial solution / solution set and the final output.Y
- The type of the feed-back data set (bulk partial solution / workset). For bulk iterations, Y
is the
same as X
public class IterationHeadTask<X,Y,S extends Function,OT> extends AbstractIterativeTask<S,OT>
Driver
inside. It will read
the initial input and establish a BlockingBackChannel
to the iteration's tail. After successfully processing
the input, it will send EndOfSuperstep events to its outputs. It must also be connected to a
synchronization task and after each superstep, it will wait
until it receives an AllWorkersDoneEvent
from the sync, which signals that all other heads have also finished
their iteration. Starting with
the second iteration, the input for the head is the output of the tail, transmitted through the backchannel. Once the
iteration is done, the head
will send a TerminationEvent
to all it's connected tasks, signaling them to shutdown.
Assumption on the ordering of the outputs: - The first n output gates write to channels that go to the tasks of the step function. - The next m output gates to to the tasks that consume the final solution. - The last output gate connects to the synchronization task.
isSolutionSetUpdate, isWorksetIteration, isWorksetUpdate, worksetAggregator, 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 |
---|
IterationHeadTask(Environment environment)
Create an Invokable task and set its environment.
|
Modifier and Type | Method and Description |
---|---|
protected int |
getNumTaskInputs() |
protected void |
initOutputs()
Creates a writer for each output.
|
void |
run() |
brokerKey, cancel, closeLocalStrategiesAndCaches, createRuntimeContext, createSolutionSetUpdateOutputCollector, createWorksetUpdateOutputCollector, createWorksetUpdateOutputCollector, currentIteration, getIterationAggregators, incrementIterationCounter, inFirstIteration, initialize, requestTermination, terminationRequested, verifyEndOfSuperstepState
cancelChainedTasks, clearReaders, clearWriters, closeChainedTasks, closeUserCode, constructLogString, createInputIterator, excludeFromReset, formatLogString, getContainingTask, getDriverComparator, getInput, getInputSerializer, getIOManager, getLastOutputCollector, getLastTasksConfig, getMemoryManager, getMetricGroup, getOutputCollector, getOutputCollector, getStub, getTaskConfig, getTaskManagerInfo, initBroadcastInputReaders, initBroadcastInputsSerializers, initInputReaders, initInputsSerializersAndComparators, initLocalStrategies, initOutputs, initStub, instantiateUserCode, invoke, logAndThrowException, openChainedTasks, openUserCode, readAndSetBroadcastInput, releaseBroadcastVariables, resetAllInputs, setLastOutputCollector
abortCheckpointOnBarrier, getCurrentNumberOfSubtasks, getEnvironment, getExecutionConfig, getIndexInSubtaskGroup, getJobConfiguration, getTaskConfiguration, getUserCodeClassLoader, notifyCheckpointComplete, setShouldInterruptOnCancel, shouldInterruptOnCancel, triggerCheckpoint, triggerCheckpointOnBarrier
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getExecutionConfig, getUserCodeClassLoader
public IterationHeadTask(Environment environment)
environment
- The environment assigned to this invokable.protected int getNumTaskInputs()
getNumTaskInputs
in class BatchTask<S extends Function,OT>
protected void initOutputs() throws Exception
BatchTask
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.