Package org.apache.bookkeeper.bookie
Interface StateManager
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
BookieStateManager
State management of Bookie, including register, turn bookie to w/r mode.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceShutdownHandler used to shutdown bookie. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the manager, release its resources.voidTurn state to the read only, just flag.voidTurn state to the shutting down progress,just the flag.voidTurn state to not registered, just the flag.voidInit state of Bookie when launch bookie.booleanCheck if the bookie is available for high priority writes or not.booleanCheck is forceReadOnly.booleanCheck is ReadOnly.booleanCheck is readOnlyModeEnabled.booleanCheck is Running.booleanCheck is Shutting down.registerBookie(boolean throwException) Register the bookie to RegistrationManager.voidsetHighPriorityWritesAvailability(boolean available) Enable/Disable the availability for high priority writes.voidtransitionToReadOnlyMode(boolean isManuallyModify) Change the state of bookie to ReadOnly mode.transitionToWritableMode(boolean isManuallyModify) Change the state of bookie to Writable mode.
-
Method Details
-
initState
void initState()Init state of Bookie when launch bookie. -
isAvailableForHighPriorityWrites
boolean isAvailableForHighPriorityWrites()Check if the bookie is available for high priority writes or not.- Returns:
- true if the bookie is available for high priority writes; otherwise false.
-
setHighPriorityWritesAvailability
void setHighPriorityWritesAvailability(boolean available) Enable/Disable the availability for high priority writes.- Parameters:
available- the flag to enable/disable the availability for high priority writes.
-
isReadOnly
boolean isReadOnly()Check is ReadOnly. -
isForceReadOnly
boolean isForceReadOnly()Check is forceReadOnly. -
isReadOnlyModeEnabled
boolean isReadOnlyModeEnabled()Check is readOnlyModeEnabled. -
isRunning
boolean isRunning()Check is Running. -
isShuttingDown
boolean isShuttingDown()Check is Shutting down. -
close
void close()Close the manager, release its resources.- Specified by:
closein interfaceAutoCloseable
-
registerBookie
Register the bookie to RegistrationManager. -
forceToShuttingDown
void forceToShuttingDown()Turn state to the shutting down progress,just the flag. -
forceToReadOnly
void forceToReadOnly()Turn state to the read only, just flag. -
forceToUnregistered
void forceToUnregistered()Turn state to not registered, just the flag. -
transitionToWritableMode
Change the state of bookie to Writable mode. -
transitionToWritableMode
-
transitionToReadOnlyMode
Change the state of bookie to ReadOnly mode. -
transitionToReadOnlyMode
-
setShutdownHandler
-