Interface IStatefulStorage
-
public interface IStatefulStorage
The interface of all storage classes for checkpoints. For each checkpoint, two types of data are stored: - Component Meta Data (one per component). - Instance Checkpoint Data (one per instance or patition) Each Stateful Storage implementation needs to handle them accordingly.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Closes the Stateful Storagevoid
dispose(String oldestCheckpointPreserved, boolean deleteAll)
Dispose checkpoints.void
init(String topologyName, Map<String,Object> conf)
Initialize the Stateful StorageCheckpoint
restoreCheckpoint(CheckpointInfo info)
Retrieve instance checkpoint.CheckpointMetadata
restoreComponentMetadata(CheckpointInfo info)
Retrieve component metadata.void
storeCheckpoint(CheckpointInfo info, Checkpoint checkpoint)
Store instance checkpoint.void
storeComponentMetaData(CheckpointInfo info, CheckpointMetadata metadata)
Store medata data for component.
-
-
-
Method Detail
-
init
void init(String topologyName, Map<String,Object> conf) throws StatefulStorageException
Initialize the Stateful Storage- Parameters:
topologyName
- The name of the topology.conf
- An unmodifiableMap containing basic configuration- Throws:
StatefulStorageException
-
close
void close()
Closes the Stateful Storage
-
storeCheckpoint
void storeCheckpoint(CheckpointInfo info, Checkpoint checkpoint) throws StatefulStorageException
Store instance checkpoint.- Parameters:
info
- The information (reference key) for the checkpoint partition.checkpoint
- The checkpoint data.- Throws:
StatefulStorageException
-
restoreCheckpoint
Checkpoint restoreCheckpoint(CheckpointInfo info) throws StatefulStorageException
Retrieve instance checkpoint.- Parameters:
info
- The information (reference key) for the checkpoint partition.- Returns:
- The checkpoint data from the specified blob id.
- Throws:
StatefulStorageException
-
storeComponentMetaData
void storeComponentMetaData(CheckpointInfo info, CheckpointMetadata metadata) throws StatefulStorageException
Store medata data for component. Ideally in distributed storages this function should only be called once for each component. In local storages, the function should be called by every instance and the data should be stored with the checkpoint data for each partition.- Parameters:
info
- The information (reference key) for the checkpoint partition.metadata
- The checkpoint metadata from a component.- Throws:
StatefulStorageException
-
restoreComponentMetadata
CheckpointMetadata restoreComponentMetadata(CheckpointInfo info) throws StatefulStorageException
Retrieve component metadata.- Parameters:
info
- The information (reference key) for the checkpoint partition.- Returns:
- The checkpoint metadata for the component.
- Throws:
StatefulStorageException
-
dispose
void dispose(String oldestCheckpointPreserved, boolean deleteAll) throws StatefulStorageException
Dispose checkpoints.- Parameters:
oldestCheckpointPreserved
- The oldest checkpoint id to be preserved. All checkpoints before this id should be deleted.deleteAll
- Ignore the checkpoint Id and delete all checkpoints.- Throws:
StatefulStorageException
-
-