Class StateControllerImpl
java.lang.Object
io.camunda.zeebe.broker.system.partitions.impl.StateControllerImpl
- All Implemented Interfaces:
StateController,AutoCloseable
Controls how snapshot/recovery operations are performed
-
Constructor Summary
ConstructorsConstructorDescriptionStateControllerImpl(ZeebeDbFactory zeebeDbFactory, ConstructableSnapshotStore constructableSnapshotStore, Path runtimeDirectory, AtomixRecordEntrySupplier entrySupplier, ToLongFunction<ZeebeDb> exporterPositionSupplier, ConcurrencyControl concurrencyControl) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()closeDb()Close db if it was opened byStateController.recover()recover()Recovers the state from the snapshot and opens the databasetakeTransientSnapshot(long lowerBoundSnapshotPosition) Takes a snapshot based on the given position.
-
Constructor Details
-
StateControllerImpl
public StateControllerImpl(ZeebeDbFactory zeebeDbFactory, ConstructableSnapshotStore constructableSnapshotStore, Path runtimeDirectory, AtomixRecordEntrySupplier entrySupplier, ToLongFunction<ZeebeDb> exporterPositionSupplier, ConcurrencyControl concurrencyControl)
-
-
Method Details
-
takeTransientSnapshot
Description copied from interface:StateControllerTakes a snapshot based on the given position. The position is a last processed lower bound event position. When the returned future completes successfully the transient snapshot will be valid.- Specified by:
takeTransientSnapshotin interfaceStateController- Parameters:
lowerBoundSnapshotPosition- the lower bound snapshot position- Returns:
- a future
-
recover
Description copied from interface:StateControllerRecovers the state from the snapshot and opens the database- Specified by:
recoverin interfaceStateController- Returns:
- ZeebeDb the database which is recovered from the snapshot.
-
closeDb
Description copied from interface:StateControllerClose db if it was opened byStateController.recover()- Specified by:
closeDbin interfaceStateController- Returns:
- future
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-