Interface StateController
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
StateControllerImpl
public interface StateController extends AutoCloseable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidconsumeReplicatedSnapshots()Registers to consumes replicated snapshots.intgetValidSnapshotsCount()Returns the current number of valid snapshots.ZeebeDbopenDb()Opens the database from the latest snapshot.voidrecover()Recovers the state from the latest snapshot.Optional<TransientSnapshot>takeTransientSnapshot(long lowerBoundSnapshotPosition)Takes a snapshot based on the given position.-
Methods inherited from interface java.lang.AutoCloseable
close
-
-
-
-
Method Detail
-
takeTransientSnapshot
Optional<TransientSnapshot> takeTransientSnapshot(long lowerBoundSnapshotPosition)
Takes a snapshot based on the given position. The position is a last processed lower bound event position.- Parameters:
lowerBoundSnapshotPosition- the lower bound snapshot position- Returns:
- a pending snapshot, or nothing if the operation fails
-
consumeReplicatedSnapshots
void consumeReplicatedSnapshots()
Registers to consumes replicated snapshots.
-
recover
void recover() throws ExceptionRecovers the state from the latest snapshot.- Throws:
Exception
-
openDb
ZeebeDb openDb()
Opens the database from the latest snapshot.- Returns:
- an opened database
-
getValidSnapshotsCount
int getValidSnapshotsCount()
Returns the current number of valid snapshots.- Returns:
- valid snapshots count
-
-