public interface StatefulTask<T extends StateHandle<?>>
Modifier and Type | Method and Description |
---|---|
void |
abortCheckpointOnBarrier(long checkpointId,
Throwable cause)
Aborts a checkpoint as the result of receiving possibly some checkpoint barriers,
but at least one
CancelCheckpointMarker . |
void |
notifyCheckpointComplete(long checkpointId)
Invoked when a checkpoint has been completed, i.e., when the checkpoint coordinator has received
the notification from all participating tasks.
|
void |
setInitialState(T stateHandle)
Sets the initial state of the operator, upon recovery.
|
boolean |
triggerCheckpoint(long checkpointId,
long timestamp)
This method is either called directly and asynchronously by the checkpoint
coordinator (in the case of functions that are directly notified - usually
the data sources), or called synchronously when all incoming channels have
reported a checkpoint barrier.
|
void |
triggerCheckpointOnBarrier(long checkpointId,
long timestamp)
This method is called when a checkpoint is triggered as a result of receiving checkpoint
barriers on all input streams.
|
void setInitialState(T stateHandle) throws Exception
stateHandle
- The handle to the state.Exception
boolean triggerCheckpoint(long checkpointId, long timestamp) throws Exception
checkpointId
- The ID of the checkpoint, incrementing.timestamp
- The timestamp when the checkpoint was triggered at the JobManager.false
if the checkpoint can not be carried out, true
otherwiseException
void triggerCheckpointOnBarrier(long checkpointId, long timestamp) throws Exception
checkpointId
- The ID of the checkpoint, incrementing.timestamp
- The timestamp when the checkpoint was triggered at the JobManager.Exception
- Exceptions thrown as the result of triggering a checkpoint are forwarded.void abortCheckpointOnBarrier(long checkpointId, Throwable cause) throws Exception
CancelCheckpointMarker
.
This requires implementing tasks to forward a
CancelCheckpointMarker
to their outputs.
checkpointId
- The ID of the checkpoint to be aborted.cause
- The reason why the checkpoint was aborted during alignmentException
void notifyCheckpointComplete(long checkpointId) throws Exception
checkpointId
- The ID of the checkpoint that is complete..Exception
- The notification method may forward its exceptions.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.