com.palominolabs.benchpress.controller.zookeeper.ZKServer类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中com.palominolabs.benchpress.controller.zookeeper.ZKServer类的一些代码示例,展示了ZKServer类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKServer类的具体详情如下:
包路径:com.palominolabs.benchpress.controller.zookeeper.ZKServer
类名称: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());
}

相关文章

ZKServer类方法