Package org.apache.pinot.common.utils
Class ZkStarter
- java.lang.Object
-
- org.apache.pinot.common.utils.ZkStarter
-
public class ZkStarter extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classZkStarter.ZookeeperInstance
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_ZK_TEST_PORT
-
Method Summary
Modifier and Type Method Description static StringgetDefaultZkStr()static ZkStarter.ZookeeperInstancestartLocalZkServer()Starts an empty local Zk instance on the default portstatic ZkStarter.ZookeeperInstancestartLocalZkServer(int port)Starts a local Zk instance with a generated empty data directorystatic ZkStarter.ZookeeperInstancestartLocalZkServer(int port, String dataDirPath)Starts a local Zk instancestatic voidstopLocalZkServer(ZkStarter.ZookeeperInstance instance)Stops a local Zk instance, deleting its data directorystatic voidstopLocalZkServer(ZkStarter.ZookeeperInstance instance, boolean deleteDataDir)Stops a local Zk instance.
-
-
-
Field Detail
-
DEFAULT_ZK_TEST_PORT
public static final int DEFAULT_ZK_TEST_PORT
- See Also:
- Constant Field Values
-
-
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 ondataDirPath- 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
-
-