Class ZkStarter


  • public class ZkStarter
    extends Object
    • Method Detail

      • startLocalZkServer

        public static ZkStarter.ZookeeperInstance startLocalZkServer()
        Starts an empty local Zk instance on the default port
      • getDefaultZkStr

        public static String getDefaultZkStr()
      • startLocalZkServer

        public static ZkStarter.ZookeeperInstance startLocalZkServer​(int port)
        Starts a local Zk instance with a generated empty data directory
        Parameters:
        port - The port to listen on
      • startLocalZkServer

        public static ZkStarter.ZookeeperInstance startLocalZkServer​(int port,
                                                                     String dataDirPath)
        Starts a local Zk instance
        Parameters:
        port - The port to listen on
        dataDirPath - The path for the Zk data directory
      • stopLocalZkServer

        public static void stopLocalZkServer​(ZkStarter.ZookeeperInstance instance)
        Stops a local Zk instance, deleting its data directory
      • stopLocalZkServer

        public static void stopLocalZkServer​(ZkStarter.ZookeeperInstance instance,
                                             boolean deleteDataDir)
        Stops a local Zk instance.
        Parameters:
        deleteDataDir - Whether or not to delete the data directory