Interface StateManager

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
BookieStateManager

public interface StateManager extends AutoCloseable
State management of Bookie, including register, turn bookie to w/r 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:
      close in interface AutoCloseable
    • registerBookie

      Future<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

      Future<Void> transitionToWritableMode(boolean isManuallyModify)
      Change the state of bookie to Writable mode.
    • transitionToWritableMode

      default Future<Void> transitionToWritableMode()
    • transitionToReadOnlyMode

      Future<Void> transitionToReadOnlyMode(boolean isManuallyModify)
      Change the state of bookie to ReadOnly mode.
    • transitionToReadOnlyMode

      default Future<Void> transitionToReadOnlyMode()
    • setShutdownHandler

      void setShutdownHandler(StateManager.ShutdownHandler handler)