public interface Checkpointable
| Modifier and Type | Interface and Description |
|---|---|
static class |
Checkpointable.Checkpoint |
static class |
Checkpointable.CheckpointContext |
| Modifier and Type | Method and Description |
|---|---|
void |
checkpointExpired(ActorId actorId,
UniqueId checkpointId)
Delete an expired checkpoint;
This method will be called when an checkpoint is expired.
|
UniqueId |
loadCheckpoint(ActorId actorId,
List<Checkpointable.Checkpoint> availableCheckpoints)
Load actor's previous checkpoint, and restore actor's state.
|
void |
saveCheckpoint(ActorId actorId,
UniqueId checkpointId)
Save a checkpoint to persistent storage.
|
boolean |
shouldCheckpoint(Checkpointable.CheckpointContext checkpointContext)
Whether this actor needs to be checkpointed.
|
boolean shouldCheckpoint(Checkpointable.CheckpointContext checkpointContext)
checkpointContext - An object that contains info about last checkpoint.void saveCheckpoint(ActorId actorId, UniqueId checkpointId)
actorId - Actor's ID.checkpointId - An ID that represents this actor's current state in GCS. You should
save this checkpoint ID together with actor's checkpoint data.UniqueId loadCheckpoint(ActorId actorId, List<Checkpointable.Checkpoint> availableCheckpoints)
actorId - Actor's ID.availableCheckpoints - A list of available checkpoint IDs and their timestamps, sorted
by timestamp in descending order. Note, this method must return the ID of one checkpoint in
this list, or null. Otherwise, an exception will be thrown.void checkpointExpired(ActorId actorId, UniqueId checkpointId)
actorId - ID of the actor.checkpointId - ID of the checkpoint that has expired.Copyright © 2020. All rights reserved.