本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperClient.close()
方法的一些代码示例,展示了ZooKeeperClient.close()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperClient.close()
方法的具体详情如下:
包路径:com.spotify.helios.servicescommon.coordination.ZooKeeperClient
类名称:ZooKeeperClient
方法名:close
暂无
代码示例来源:origin: spotify/helios
@Override
public void close() {
client.close();
}
代码示例来源:origin: spotify/helios
@Override
protected void shutDown() throws Exception {
server.stop();
server.join();
registrar.close();
agentReaper.ifPresent(reaper -> reaper.stopAsync().awaitTerminated());
oldJobReaper.ifPresent(reaper -> reaper.stopAsync().awaitTerminated());
jobHistoryReaper.ifPresent(reaper -> reaper.stopAsync().awaitTerminated());
rollingUpdateService.stopAsync().awaitTerminated();
expiredJobReaper.stopAsync().awaitTerminated();
zkRegistrar.stopAsync().awaitTerminated();
zooKeeperClient.close();
}
代码示例来源:origin: spotify/helios
static void initializeAcl(final String zooKeeperConnectionString,
final String zooKeeperClusterId,
final String masterUser,
final String masterPassword,
final String agentUser,
final String agentPassword)
throws KeeperException {
final ACLProvider aclProvider = heliosAclProvider(
masterUser, digest(masterUser, masterPassword),
agentUser, digest(agentUser, agentPassword));
final List<AuthInfo> authorization = Lists.newArrayList(new AuthInfo(
"digest", String.format("%s:%s", masterUser, masterPassword).getBytes()));
final RetryPolicy zooKeeperRetryPolicy = new ExponentialBackoffRetry(1000, 3);
final CuratorFramework curator = new CuratorClientFactoryImpl().newClient(
zooKeeperConnectionString,
(int) TimeUnit.SECONDS.toMillis(60),
(int) TimeUnit.SECONDS.toMillis(15),
zooKeeperRetryPolicy,
aclProvider,
authorization);
final ZooKeeperClient client = new DefaultZooKeeperClient(curator, zooKeeperClusterId);
try {
client.start();
initializeAclRecursive(client, "/", aclProvider);
} finally {
client.close();
}
}
代码示例来源:origin: spotify/helios
@Override
protected void shutDown() throws Exception {
if (server != null) {
server.stop();
}
hostInfoReporter.stopAsync().awaitTerminated();
agentInfoReporter.stopAsync().awaitTerminated();
environmentVariableReporter.stopAsync().awaitTerminated();
labelReporter.stopAsync().awaitTerminated();
agent.stopAsync().awaitTerminated();
if (serviceRegistrar != null) {
serviceRegistrar.close();
}
zkRegistrar.stopAsync().awaitTerminated();
model.stopAsync().awaitTerminated();
metrics.stop();
zooKeeperClient.close();
try {
stateLock.release();
} catch (IOException e) {
log.error("Failed to release state lock", e);
}
try {
stateLockFile.close();
} catch (IOException e) {
log.error("Failed to close state lock file", e);
}
}
代码示例来源:origin: at.molindo/helios-services
@Override
public void close() {
client.close();
}
代码示例来源:origin: at.molindo/helios-services
@Override
protected void shutDown() throws Exception {
server.stop();
server.join();
registrar.close();
rollingUpdateService.stopAsync().awaitTerminated();
expiredJobReaper.stopAsync().awaitTerminated();
zkRegistrar.stopAsync().awaitTerminated();
zooKeeperClient.close();
}
代码示例来源:origin: at.molindo/helios-services
@Override
protected void shutDown() throws Exception {
if (server != null) {
server.stop();
}
hostInfoReporter.stopAsync().awaitTerminated();
agentInfoReporter.stopAsync().awaitTerminated();
environmentVariableReporter.stopAsync().awaitTerminated();
labelReporter.stopAsync().awaitTerminated();
agent.stopAsync().awaitTerminated();
if (serviceRegistrar != null) {
serviceRegistrar.close();
}
zkRegistrar.stopAsync().awaitTerminated();
model.stopAsync().awaitTerminated();
metrics.stop();
zooKeeperClient.close();
try {
stateLock.release();
} catch (IOException e) {
log.error("Failed to release state lock", e);
}
try {
stateLockFile.close();
} catch (IOException e) {
log.error("Failed to close state lock file", e);
}
}
内容来源于网络,如有侵权,请联系作者删除!