Class BookieServer


  • public class BookieServer
    extends java.lang.Object
    Implements the server-side part of the BookKeeper protocol.
    • Method Detail

      • setExceptionHandler

        public void setExceptionHandler​(java.lang.Thread.UncaughtExceptionHandler exceptionHandler)
        Currently the uncaught exception handler is used for DeathWatcher to notify lifecycle management that a bookie is dead for some reasons.

        in future, we can register this exceptionHandler to critical threads so when those threads are dead, it will automatically trigger lifecycle management to shutdown the process.

      • start

        public void start()
                   throws java.lang.InterruptedException,
                          java.io.IOException
        Throws:
        java.lang.InterruptedException
        java.io.IOException
      • getLocalAddress

        public BookieSocketAddress getLocalAddress()
                                            throws java.net.UnknownHostException
        Throws:
        java.net.UnknownHostException
      • getBookieId

        public BookieId getBookieId()
                             throws java.net.UnknownHostException
        Throws:
        java.net.UnknownHostException
      • getBookie

        public Bookie getBookie()
      • suspendProcessing

        public void suspendProcessing()
        Suspend processing of requests in the bookie (for testing).
      • resumeProcessing

        public void resumeProcessing()
        Resume processing requests in the bookie (for testing).
      • shutdown

        public void shutdown()
      • isRunning

        public boolean isRunning()
      • isBookieRunning

        public boolean isBookieRunning()
        Whether bookie is running?
        Returns:
        true if bookie is running, otherwise return false
      • join

        public void join()
                  throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • getExitCode

        public int getExitCode()
      • main

        public static void main​(java.lang.String[] args)
        Legacy Method to run bookie server.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object