本文整理了Java中com.palominolabs.benchpress.controller.zookeeper.ZKServer
类的一些代码示例,展示了ZKServer
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKServer
类的具体详情如下:
包路径:com.palominolabs.benchpress.controller.zookeeper.ZKServer
类名称:ZKServer
暂无
代码示例来源:origin: palominolabs/benchpress
void go() throws Exception {
// Disable Zookeeper's annoying attempt to start its own out-of-date Jetty
System.setProperty("zookeeper.admin.enableServer", "false");
if (zkServer.isEnabled()) {
Future<?> zkFuture = zkServerExService.submit(zkServer);
zkServerExService.submit(new FutureWatcher(zkFuture));
} else {
logger.info("Not running embedded ZooKeeper server");
}
String host = "localhost";
int port = 7000;
HttpServerWrapperConfig config = new HttpServerWrapperConfig()
.withHttpServerConnectorConfig(HttpServerConnectorConfig.forHttp(host, port));
httpServerFactory.getHttpServerWrapper(config).start();
curatorLifecycleHook.start();
logger.info("Controller started listening on port " + port);
jobFarmer.setListenAddress(host);
jobFarmer.setListenPort(port);
}
代码示例来源:origin: palominolabs/benchpress
@After
public void tearDown() throws Exception {
curatorLifecycleHook.close();
zkServer.close();
executorService.shutdownNow();
if (!executorService.awaitTermination(1, TimeUnit.SECONDS)) {
throw new RuntimeException("Executor did not shut down");
}
httpServer.stop();
asyncHttpClient.close();
}
代码示例来源:origin: palominolabs/benchpress
void go() throws Exception {
if (zkServer.isEnabled()) {
Future<?> zkFuture = zkServerExService.submit(zkServer);
zkServerExService.submit(new FutureWatcher(zkFuture));
} else {
logger.info("Not running embedded ZooKeeper server");
}
HttpServerWrapperConfig config = new HttpServerWrapperConfig().withHttpServerConnectorConfig(
forHttp(controllerConfig.getHttpServerIp(), controllerConfig.getHttpServerPort()));
HttpServerWrapper httpServer = httpServerFactory.getHttpServerWrapper(config);
httpServer.start();
curatorLifecycleHook.start();
logger.info("Controller started listening on port " + controllerConfig.getHttpServerPort());
jobFarmer.setListenAddress(controllerConfig.getHttpServerIp());
jobFarmer.setListenPort(controllerConfig.getHttpServerPort());
}
内容来源于网络,如有侵权,请联系作者删除!