本文整理了Java中org.I0Itec.zkclient.ZkServer.<init>()
方法的一些代码示例,展示了ZkServer.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkServer.<init>()
方法的具体详情如下:
包路径:org.I0Itec.zkclient.ZkServer
类名称:ZkServer
方法名:<init>
暂无
代码示例来源:origin: apache/incubator-pinot
public boolean start(int zkPort) {
IDefaultNameSpace defaultNameSpace = new IDefaultNameSpace() {
@Override
public void createDefaultNameSpace(org.I0Itec.zkclient.ZkClient zkClient) {
// init any zk paths if needed
}
};
LOGGER.info("Starting zookeeper at localhost:{} in thread: {}", zkPort, Thread.currentThread().getName());
_zkServer = new ZkServer(_dataDir, _logDir, defaultNameSpace, zkPort, 30000, 60000);
_zkServer.start();
return true;
}
代码示例来源:origin: apache/helix
public void start(int port, String dataDir, String logDir) throws Exception {
IDefaultNameSpace defaultNameSpace = new IDefaultNameSpace() {
@Override
public void createDefaultNameSpace(ZkClient zkClient) {
}
};
ZkServer server = new ZkServer(dataDir, logDir, defaultNameSpace, port);
server.start();
Thread.currentThread().join();
}
代码示例来源:origin: ezbz/projectx
@Override
public void afterPropertiesSet() throws Exception {
zkServer = new ZkServer(dataDirectory, logDirectory, defaultNameSpace, port, tickTime,
minSessionTimeout);
zkServer.start();
}
代码示例来源:origin: org.apache.helix/helix-core
public void start(int port, String dataDir, String logDir) throws Exception {
IDefaultNameSpace defaultNameSpace = new IDefaultNameSpace() {
@Override
public void createDefaultNameSpace(ZkClient zkClient) {
}
};
ZkServer server = new ZkServer(dataDir, logDir, defaultNameSpace, port);
server.start();
Thread.currentThread().join();
}
代码示例来源:origin: apache/helix
private static void startLocalZookeeper(int port) throws Exception {
ZkServer server = null;
String baseDir = "/tmp/IntegrationTest/";
final String dataDir = baseDir + "zk/dataDir";
final String logDir = baseDir + "/tmp/logDir";
FileUtils.deleteDirectory(new File(dataDir));
FileUtils.deleteDirectory(new File(logDir));
IDefaultNameSpace defaultNameSpace = new IDefaultNameSpace() {
@Override
public void createDefaultNameSpace(ZkClient zkClient) {
}
};
int zkPort = 2199;
final String zkAddress = "localhost:" + zkPort;
server = new ZkServer(dataDir, logDir, defaultNameSpace, zkPort);
server.start();
}
代码示例来源:origin: apache/helix
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();
}
代码示例来源:origin: org.apache.helix/helix-core
public static ZkServer startZkServer(String zkAddr) {
System.out.println("Start zookeeper at " + zkAddr + " in thread "
+ Thread.currentThread().getName());
String zkDir = zkAddr.replace(':', '_');
final String logDir = "/tmp/" + zkDir + "/logs";
final String dataDir = "/tmp/" + zkDir + "/dataDir";
try {
FileUtils.deleteDirectory(new File(dataDir));
FileUtils.deleteDirectory(new File(logDir));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
IDefaultNameSpace defaultNameSpace = new IDefaultNameSpace() {
@Override
public void createDefaultNameSpace(org.I0Itec.zkclient.ZkClient zkClient) {
// do nothing
}
};
int port = Integer.parseInt(zkAddr.substring(zkAddr.lastIndexOf(':') + 1));
ZkServer zkServer = new ZkServer(dataDir, logDir, defaultNameSpace, port);
zkServer.start();
return zkServer;
}
代码示例来源:origin: apache/helix
public static ZkServer startZkServer(String zkAddr) {
System.out.println("Start zookeeper at " + zkAddr + " in thread "
+ Thread.currentThread().getName());
String zkDir = zkAddr.replace(':', '_');
final String logDir = "/tmp/" + zkDir + "/logs";
final String dataDir = "/tmp/" + zkDir + "/dataDir";
try {
FileUtils.deleteDirectory(new File(dataDir));
FileUtils.deleteDirectory(new File(logDir));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
IDefaultNameSpace defaultNameSpace = new IDefaultNameSpace() {
@Override
public void createDefaultNameSpace(org.I0Itec.zkclient.ZkClient zkClient) {
// do nothing
}
};
int port = Integer.parseInt(zkAddr.substring(zkAddr.lastIndexOf(':') + 1));
ZkServer zkServer = new ZkServer(dataDir, logDir, defaultNameSpace, port);
zkServer.start();
return zkServer;
}
代码示例来源:origin: org.apache.helix/helix-core
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();
}
代码示例来源:origin: apache/helix
final String zkAddress = "localhost:" + zkPort;
server = new ZkServer(dataDir, logDir, defaultNameSpace, zkPort);
server.start();
ClusterSetup setup = new ClusterSetup(zkAddress);
代码示例来源:origin: apache/helix
ZkServer zkServer = new ZkServer(dataDir, logDir, defaultNameSpace, port);
zkServer.start();
代码示例来源:origin: apache/helix
private static void setup() {
IDefaultNameSpace defaultNameSpace = new IDefaultNameSpace() {
@Override
public void createDefaultNameSpace(org.I0Itec.zkclient.ZkClient client) {
client.deleteRecursive("/" + clusterName);
}
};
zkServer = new ZkServer(dataDir, logDir, defaultNameSpace, port);
zkServer.start();
ClusterSetup clusterSetup = new ClusterSetup(zkConnectString);
clusterSetup.setupTestCluster(clusterName);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
内容来源于网络,如有侵权,请联系作者删除!