com.palominolabs.benchpress.controller.zookeeper.ZKServer.isEnabled()方法的使用及代码示例

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

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

ZKServer.isEnabled介绍

暂无

代码示例

代码示例来源: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

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类方法