Class BookieStateManager

  • All Implemented Interfaces:
    java.lang.AutoCloseable, StateManager

    @StatsDoc(name="bookie",
              category="server",
              help="Bookie state manager related stats")
    public class BookieStateManager
    extends java.lang.Object
    implements StateManager
    An implementation of StateManager.
    • Field Detail

      • stateService

        final java.util.concurrent.ScheduledExecutorService stateService
    • Method Detail

      • initState

        public void initState()
        Description copied from interface: StateManager
        Init state of Bookie when launch bookie.
        Specified by:
        initState in interface StateManager
      • forceToShuttingDown

        public void forceToShuttingDown()
        Description copied from interface: StateManager
        Turn state to the shutting down progress,just the flag.
        Specified by:
        forceToShuttingDown in interface StateManager
      • forceToReadOnly

        public void forceToReadOnly()
        Description copied from interface: StateManager
        Turn state to the read only, just flag.
        Specified by:
        forceToReadOnly in interface StateManager
      • isAvailableForHighPriorityWrites

        public boolean isAvailableForHighPriorityWrites()
        Description copied from interface: StateManager
        Check if the bookie is available for high priority writes or not.
        Specified by:
        isAvailableForHighPriorityWrites in interface StateManager
        Returns:
        true if the bookie is available for high priority writes; otherwise false.
      • setHighPriorityWritesAvailability

        public void setHighPriorityWritesAvailability​(boolean available)
        Description copied from interface: StateManager
        Enable/Disable the availability for high priority writes.
        Specified by:
        setHighPriorityWritesAvailability in interface StateManager
        Parameters:
        available - the flag to enable/disable the availability for high priority writes.
      • close

        public void close()
        Description copied from interface: StateManager
        Close the manager, release its resources.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface StateManager
      • registerBookie

        public java.util.concurrent.Future<java.lang.Void> registerBookie​(boolean throwException)
        Description copied from interface: StateManager
        Register the bookie to RegistrationManager.
        Specified by:
        registerBookie in interface StateManager
      • transitionToWritableMode

        public java.util.concurrent.Future<java.lang.Void> transitionToWritableMode()
        Description copied from interface: StateManager
        Change the state of bookie to Writable mode.
        Specified by:
        transitionToWritableMode in interface StateManager
      • transitionToReadOnlyMode

        public java.util.concurrent.Future<java.lang.Void> transitionToReadOnlyMode()
        Description copied from interface: StateManager
        Change the state of bookie to ReadOnly mode.
        Specified by:
        transitionToReadOnlyMode in interface StateManager
      • doRegisterBookie

        void doRegisterBookie()
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • doTransitionToWritableMode

        public void doTransitionToWritableMode()
      • doTransitionToReadOnlyMode

        public void doTransitionToReadOnlyMode()
      • isRegistered

        boolean isRegistered()