Package org.apache.bookkeeper.bookie
Interface StateManager
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
BookieStateManager
public interface StateManager extends java.lang.AutoCloseable
State management of Bookie, including register, turn bookie to w/r mode.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
StateManager.ShutdownHandler
ShutdownHandler used to shutdown bookie.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Close the manager, release its resources.void
forceToReadOnly()
Turn state to the read only, just flag.void
forceToShuttingDown()
Turn state to the shutting down progress,just the flag.void
forceToUnregistered()
Turn state to not registered, just the flag.void
initState()
Init state of Bookie when launch bookie.boolean
isAvailableForHighPriorityWrites()
Check if the bookie is available for high priority writes or not.boolean
isForceReadOnly()
Check is forceReadOnly.boolean
isReadOnly()
Check is ReadOnly.boolean
isReadOnlyModeEnabled()
Check is readOnlyModeEnabled.boolean
isRunning()
Check is Running.boolean
isShuttingDown()
Check is Shutting down.java.util.concurrent.Future<java.lang.Void>
registerBookie(boolean throwException)
Register the bookie to RegistrationManager.void
setHighPriorityWritesAvailability(boolean available)
Enable/Disable the availability for high priority writes.void
setShutdownHandler(StateManager.ShutdownHandler handler)
java.util.concurrent.Future<java.lang.Void>
transitionToReadOnlyMode()
Change the state of bookie to ReadOnly mode.java.util.concurrent.Future<java.lang.Void>
transitionToWritableMode()
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:
close
in 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()
Change the state of bookie to Writable mode.
-
transitionToReadOnlyMode
java.util.concurrent.Future<java.lang.Void> transitionToReadOnlyMode()
Change the state of bookie to ReadOnly mode.
-
setShutdownHandler
void setShutdownHandler(StateManager.ShutdownHandler handler)
-
-