io.pravega.segmentstore.storage.impl.bookkeeper.ZooKeeperServiceRunner.close()方法的使用及代码示例

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

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

ZooKeeperServiceRunner.close介绍

暂无

代码示例

代码示例来源:origin: pravega/pravega

@Override
public void close() throws Exception {
  try {
    this.servers.stream().filter(Objects::nonNull).forEach(BookieServer::shutdown);
    if (this.zkServer.get() != null) {
      this.zkServer.get().close();
    }
  } finally {
    cleanupDirectories();
  }
  Thread c = this.cleanup.getAndSet(null);
  if (c != null) {
    Runtime.getRuntime().removeShutdownHook(c);
  }
}

代码示例来源:origin: pravega/pravega

/**
 * Resumes ZooKeeper (if it had previously been suspended).
 *
 * @throws Exception If an exception got thrown.
 */
public void resumeZooKeeper() throws Exception {
  val zk = new ZooKeeperServiceRunner(this.zkPort, this.secureZK, this.tLSKeyStore, this.tLSKeyStorePasswordPath, this.tlsTrustStore);
  if (this.zkServer.compareAndSet(null, zk)) {
    // Initialize ZK runner (since nobody else did it for us).
    zk.initialize();
    log.info("ZooKeeper initialized.");
  } else {
    zk.close();
  }
  // Start or resume ZK.
  this.zkServer.get().start();
  log.info("ZooKeeper resumed.");
}

代码示例来源:origin: pravega/pravega

@Override
  @Synchronized
  public void close() throws Exception {
    if (isInProcSegmentStore) {
      for ( ServiceStarter starter : this.nodeServiceStarter ) {
        starter.shutdown();
      }
    }
    if (isInProcController) {
      for ( ControllerServiceMain controller : this.controllerServers ) {
          controller.stopAsync();
        }
    }

    if (this.zkService != null) {
      this.zkService.close();
      this.zkService = null;
    }
  }
}

相关文章