Search in sources :

Example 11 with IDefaultNameSpace

use of org.I0Itec.zkclient.IDefaultNameSpace in project helix by apache.

the class Quickstart method startZookeeper.

public static void startZookeeper() {
    echo("STARTING Zookeeper at " + ZK_ADDRESS);
    IDefaultNameSpace defaultNameSpace = new IDefaultNameSpace() {

        @Override
        public void createDefaultNameSpace(ZkClient zkClient) {
        }
    };
    new File("/tmp/helix-quickstart").mkdirs();
    // start zookeeper
    ZkServer server = new ZkServer("/tmp/helix-quickstart/dataDir", "/tmp/helix-quickstart/logDir", defaultNameSpace, 2199);
    server.start();
}
Also used : ZkClient(org.I0Itec.zkclient.ZkClient) IDefaultNameSpace(org.I0Itec.zkclient.IDefaultNameSpace) File(java.io.File) ZkServer(org.I0Itec.zkclient.ZkServer)

Example 12 with IDefaultNameSpace

use of org.I0Itec.zkclient.IDefaultNameSpace in project databus by linkedin.

the class TestUtil method startZkServer.

public static ZkServer startZkServer(String zkTestDataRootDir, int machineId, int port, int tickTime) throws IOException {
    File zkTestDataRootDirFile = new File(zkTestDataRootDir);
    zkTestDataRootDirFile.mkdirs();
    String dataPath = zkTestDataRootDir + "/" + machineId + "/" + port + "/data";
    String logPath = zkTestDataRootDir + "/" + machineId + "/" + port + "/log";
    FileUtils.deleteDirectory(new File(dataPath));
    FileUtils.deleteDirectory(new File(logPath));
    IDefaultNameSpace mockDefaultNameSpace = new IDefaultNameSpace() {

        @Override
        public void createDefaultNameSpace(ZkClient zkClient) {
        }
    };
    ZkServer zkServer = new ZkServer(dataPath, logPath, mockDefaultNameSpace, port, tickTime);
    zkServer.start();
    return zkServer;
}
Also used : ZkClient(org.I0Itec.zkclient.ZkClient) IDefaultNameSpace(org.I0Itec.zkclient.IDefaultNameSpace) File(java.io.File) ZkServer(org.I0Itec.zkclient.ZkServer)

Aggregations

IDefaultNameSpace (org.I0Itec.zkclient.IDefaultNameSpace)12 ZkServer (org.I0Itec.zkclient.ZkServer)11 File (java.io.File)9 ZkClient (org.I0Itec.zkclient.ZkClient)7 IOException (java.io.IOException)3 ClusterSetup (org.apache.helix.tools.ClusterSetup)2 ZkNoNodeException (org.I0Itec.zkclient.exception.ZkNoNodeException)1 HelixManager (org.apache.helix.HelixManager)1 ZkClient (org.apache.helix.manager.zk.ZkClient)1