|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.s4.core.ft.DefaultFileSystemStateStorage
public class DefaultFileSystemStateStorage
Implementation of a file system backend storage to persist checkpoints.
The file system may be the default local file system when running on a single machine, but should be a distributed file system such as NFS when running on a cluster.
Checkpoints are stored in individual files (1 file = 1 checkpointId) in directories according to the following
structure: (storageRootpath)/prototypeId/checkpointId
Constructor Summary | |
---|---|
DefaultFileSystemStateStorage()
|
Method Summary | |
---|---|
void |
checkStorageDir()
|
byte[] |
fetchState(CheckpointId key)
Fetches data for a stored checkpoint. |
java.util.Set<CheckpointId> |
fetchStoredKeys()
Fetches all stored safeKeeper Ids. |
void |
init()
Called by the dependency injection framework, after construction. |
void |
saveState(CheckpointId key,
byte[] state,
StorageCallback callback)
Stores a checkpoint. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultFileSystemStateStorage()
Method Detail |
---|
@Inject public void init()
Called by the dependency injection framework, after construction.
public byte[] fetchState(CheckpointId key)
StateStorage
Must return null if storage does not contain this key.
fetchState
in interface StateStorage
key
- safeKeeperId for this checkpoint
public java.util.Set<CheckpointId> fetchStoredKeys()
StateStorage
fetchStoredKeys
in interface StateStorage
public void checkStorageDir()
public void saveState(CheckpointId key, byte[] state, StorageCallback callback)
StateStorage
NOTE: we don't handle any failure/success return value, because all failure/success notifications go through the StorageCallback reference
saveState
in interface StateStorage
key
- safeKeeperIdstate
- checkpoint data as a byte arraycallback
- callback for receiving notifications of storage operations. This callback is configurable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |