Class LocalBookKeeper

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class LocalBookKeeper
    extends java.lang.Object
    implements java.lang.AutoCloseable
    Local Bookkeeper.
    • Field Detail

      • LOG

        protected static final org.slf4j.Logger LOG
      • numberOfBookies

        int numberOfBookies
      • localBookies

        java.util.List<org.apache.bookkeeper.util.LocalBookKeeper.LocalBookie> localBookies
      • zkHost

        java.lang.String zkHost
      • zkPort

        int zkPort
      • dirSuffix

        java.lang.String dirSuffix
      • localBookiesConfigDir

        java.io.File localBookiesConfigDir
      • dirsToCleanUp

        java.util.List<java.io.File> dirsToCleanUp
      • stopOnExit

        boolean stopOnExit
    • Constructor Detail

      • LocalBookKeeper

        public LocalBookKeeper​(int numberOfBookies,
                               ServerConfiguration baseConf,
                               java.lang.String localBookiesConfigDirName,
                               boolean stopOnExit,
                               java.lang.String dirSuffix,
                               java.lang.String zkHost,
                               int zkPort)
    • Method Detail

      • runZookeeper

        public static ZooKeeperServerShim runZookeeper​(int maxCC,
                                                       int zookeeperPort)
                                                throws java.io.IOException
        Parameters:
        maxCC - Max Concurrency of Client
        zookeeperPort - ZooKeeper Server Port
        Throws:
        java.io.IOException
      • runZookeeper

        public static ZooKeeperServerShim runZookeeper​(int maxCC,
                                                       int zookeeperPort,
                                                       java.io.File zkDir)
                                                throws java.io.IOException
        Throws:
        java.io.IOException
      • getLocalBookies

        public static LocalBookKeeper getLocalBookies​(java.lang.String zkHost,
                                                      int zkPort,
                                                      int numBookies,
                                                      boolean shouldStartZK,
                                                      ServerConfiguration conf)
                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • main

        public static void main​(java.lang.String[] args)
      • waitForServerUp

        public static boolean waitForServerUp​(java.lang.String hp,
                                              long timeout)
      • start

        public void start()
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addBookie

        public void addBookie()
                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • removeBookie

        public void removeBookie()
                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • shutdownBookies

        public void shutdownBookies()
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception