Package org.apache.flink.runtime.state
Interface LocalSnapshotDirectoryProvider
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
LocalSnapshotDirectoryProviderImpl
Provides directories for local backup or local recovery. It offers access to the allocation base
directories (i.e. the root directories for all local state that is created under the same
allocation id) and the subtask-specific paths, which contain the local state for one subtask.
Access by checkpoint id rotates over all root directory indexes, in case that there is more than
one. Selection methods are provided to pick the directory under a certain index. Directory
structures are of the following shape:
|-----allocationBaseDirectory------| |-----subtaskBaseDirectory--------------------------------------| |-----subtaskSpecificCheckpointDirectory------------------------------| ../local_state_root_1/allocation_id/job_id/vertex_id_subtask_idx/chk_1/(state) ../local_state_root_2/allocation_id/job_id/vertex_id_subtask_idx/chk_2/(state) (...)
-
Method Summary
Modifier and TypeMethodDescriptionallocationBaseDirectory(long checkpointId) Returns the local state allocation base directory for given checkpoint id w.r.t. our rotation over all available allocation base directories.intReturns the total number of allocation base directories.selectAllocationBaseDirectory(int idx) Returns a specific allocation base directory.selectSubtaskBaseDirectory(int idx) Returns a specific subtask base directory.subtaskBaseDirectory(long checkpointId) Returns the local state directory for the owning subtask the given checkpoint id w.r.t. our rotation over all available available allocation base directories.subtaskSpecificCheckpointDirectory(long checkpointId) Returns the local state directory for the specific operator subtask and the given checkpoint id w.r.t. our rotation over all available root dirs.
-
Method Details
-
allocationBaseDirectory
Returns the local state allocation base directory for given checkpoint id w.r.t. our rotation over all available allocation base directories. -
subtaskBaseDirectory
Returns the local state directory for the owning subtask the given checkpoint id w.r.t. our rotation over all available available allocation base directories. This directory is contained in the directory returned byallocationBaseDirectory(long)for the same checkpoint id. -
subtaskSpecificCheckpointDirectory
Returns the local state directory for the specific operator subtask and the given checkpoint id w.r.t. our rotation over all available root dirs. This directory is contained in the directory returned bysubtaskBaseDirectory(long)for the same checkpoint id. -
selectAllocationBaseDirectory
Returns a specific allocation base directory. The index must be between 0 (incl.) andallocationBaseDirsCount()(excl.). -
selectSubtaskBaseDirectory
Returns a specific subtask base directory. The index must be between 0 (incl.) andallocationBaseDirsCount()(excl.). This directory is direct a child ofselectSubtaskBaseDirectory(int)given the same index. -
allocationBaseDirsCount
int allocationBaseDirsCount()Returns the total number of allocation base directories.
-