Package org.apache.bookkeeper.bookie
Interface StateManager
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
BookieStateManager
public interface StateManager extends java.lang.AutoCloseableState management of Bookie, including register, turn bookie to w/r mode.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceStateManager.ShutdownHandlerShutdownHandler used to shutdown bookie.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidclose()Close the manager, release its resources.voidforceToReadOnly()Turn state to the read only, just flag.voidforceToShuttingDown()Turn state to the shutting down progress,just the flag.voidforceToUnregistered()Turn state to not registered, just the flag.voidinitState()Init state of Bookie when launch bookie.booleanisAvailableForHighPriorityWrites()Check if the bookie is available for high priority writes or not.booleanisForceReadOnly()Check is forceReadOnly.booleanisReadOnly()Check is ReadOnly.booleanisReadOnlyModeEnabled()Check is readOnlyModeEnabled.booleanisRunning()Check is Running.booleanisShuttingDown()Check is Shutting down.java.util.concurrent.Future<java.lang.Void>registerBookie(boolean throwException)Register the bookie to RegistrationManager.voidsetHighPriorityWritesAvailability(boolean available)Enable/Disable the availability for high priority writes.voidsetShutdownHandler(StateManager.ShutdownHandler handler)default java.util.concurrent.Future<java.lang.Void>transitionToReadOnlyMode()java.util.concurrent.Future<java.lang.Void>transitionToReadOnlyMode(boolean isManuallyModify)Change the state of bookie to ReadOnly mode.default java.util.concurrent.Future<java.lang.Void>transitionToWritableMode()java.util.concurrent.Future<java.lang.Void>transitionToWritableMode(boolean isManuallyModify)Change the state of bookie to Writable mode.
-
-
-
Method Detail
-
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 interfacejava.lang.AutoCloseable
-
registerBookie
java.util.concurrent.Future<java.lang.Void> registerBookie(boolean throwException)
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
java.util.concurrent.Future<java.lang.Void> transitionToWritableMode(boolean isManuallyModify)
Change the state of bookie to Writable mode.
-
transitionToWritableMode
default java.util.concurrent.Future<java.lang.Void> transitionToWritableMode()
-
transitionToReadOnlyMode
java.util.concurrent.Future<java.lang.Void> transitionToReadOnlyMode(boolean isManuallyModify)
Change the state of bookie to ReadOnly mode.
-
transitionToReadOnlyMode
default java.util.concurrent.Future<java.lang.Void> transitionToReadOnlyMode()
-
setShutdownHandler
void setShutdownHandler(StateManager.ShutdownHandler handler)
-
-