Package io.camunda.zeebe.snapshots.impl
Class FileBasedSnapshotStoreFactory
java.lang.Object
io.camunda.zeebe.snapshots.impl.FileBasedSnapshotStoreFactory
- All Implemented Interfaces:
ReceivableSnapshotStoreFactory
public final class FileBasedSnapshotStoreFactory
extends Object
implements ReceivableSnapshotStoreFactory
Loads existing snapshots in memory, cleaning out old and/or invalid snapshots if present.
The current load strategy is to lookup all files directly under the
SNAPSHOTS_DIRECTORY, try to extract FileBasedSnapshotId from them, and if not possible
skip them (and print out a warning).
The metadata extraction is done by parsing the directory name using '%d-%d-%d-%d', where in order we expect: index, term, processed position and exported position.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFileBasedSnapshotStoreFactory(ActorSchedulingService actorScheduler, int nodeId) -
Method Summary
Modifier and TypeMethodDescriptioncreateReceivableSnapshotStore(Path root, int partitionId) Creates a snapshot store operating in the givendirectory.static RestorableSnapshotStorecreateRestorableSnapshotStore(Path root, int partitionId, int nodeId) getConstructableSnapshotStore(int partitionId) getPersistedSnapshotStore(int partitionId) getReceivableSnapshotStore(int partitionId) getSnapshotStoreConcurrencyControl(int partitionId) Deprecated.
-
Field Details
-
SNAPSHOTS_DIRECTORY
- See Also:
-
PENDING_DIRECTORY
- See Also:
-
-
Constructor Details
-
FileBasedSnapshotStoreFactory
-
-
Method Details
-
createRestorableSnapshotStore
public static RestorableSnapshotStore createRestorableSnapshotStore(Path root, int partitionId, int nodeId) -
createReceivableSnapshotStore
Description copied from interface:ReceivableSnapshotStoreFactoryCreates a snapshot store operating in the givendirectory.- Specified by:
createReceivableSnapshotStorein interfaceReceivableSnapshotStoreFactory- Parameters:
root- the root directory where snapshots should be storedpartitionId- the id of the partition for this store- Returns:
- a new
PersistedSnapshotStore
-
getConstructableSnapshotStore
-
getReceivableSnapshotStore
-
getPersistedSnapshotStore
-
getSnapshotStoreConcurrencyControl
Deprecated.Return the same concurrent control (actor) that is used by the snapshot store of the given partition- Parameters:
partitionId-- Returns:
- concurrency control
-