public class StandaloneCompletedCheckpointStore extends Object implements CompletedCheckpointStore
CompletedCheckpointStore
for JobManagers running in HighAvailabilityMode.NONE
.Constructor and Description |
---|
StandaloneCompletedCheckpointStore(int maxNumberOfCheckpointsToRetain)
Creates
StandaloneCompletedCheckpointStore . |
Modifier and Type | Method and Description |
---|---|
void |
addCheckpoint(CompletedCheckpoint checkpoint)
Adds a
CompletedCheckpoint instance to the list of completed checkpoints. |
List<CompletedCheckpoint> |
getAllCheckpoints()
Returns all
CompletedCheckpoint instances. |
CompletedCheckpoint |
getLatestCheckpoint()
Returns the latest
CompletedCheckpoint instance or null if none was
added. |
int |
getNumberOfRetainedCheckpoints()
Returns the current number of retained checkpoints.
|
void |
recover()
Recover available
CompletedCheckpoint instances. |
void |
shutdown(JobStatus jobStatus)
Shuts down the store.
|
public StandaloneCompletedCheckpointStore(int maxNumberOfCheckpointsToRetain)
StandaloneCompletedCheckpointStore
.maxNumberOfCheckpointsToRetain
- The maximum number of checkpoints to retain (at
least 1). Adding more checkpoints than this results
in older checkpoints being discarded.public void recover() throws Exception
CompletedCheckpointStore
CompletedCheckpoint
instances.
After a call to this method, CompletedCheckpointStore.getLatestCheckpoint()
returns the latest
available checkpoint.
recover
in interface CompletedCheckpointStore
Exception
public void addCheckpoint(CompletedCheckpoint checkpoint) throws Exception
CompletedCheckpointStore
CompletedCheckpoint
instance to the list of completed checkpoints.
Only a bounded number of checkpoints is kept. When exceeding the maximum number of
retained checkpoints, the oldest one will be discarded via CompletedCheckpoint.discard()
.
addCheckpoint
in interface CompletedCheckpointStore
Exception
public CompletedCheckpoint getLatestCheckpoint()
CompletedCheckpointStore
CompletedCheckpoint
instance or null
if none was
added.getLatestCheckpoint
in interface CompletedCheckpointStore
public List<CompletedCheckpoint> getAllCheckpoints()
CompletedCheckpointStore
CompletedCheckpoint
instances.
Returns an empty list if no checkpoint has been added yet.
getAllCheckpoints
in interface CompletedCheckpointStore
public int getNumberOfRetainedCheckpoints()
CompletedCheckpointStore
getNumberOfRetainedCheckpoints
in interface CompletedCheckpointStore
public void shutdown(JobStatus jobStatus) throws Exception
CompletedCheckpointStore
The job status is forwarded and used to decide whether state should actually be discarded or kept.
shutdown
in interface CompletedCheckpointStore
jobStatus
- Job state on shut downException
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.