gpt4 book ai didi

com.spotify.helios.servicescommon.coordination.ZooKeeperClient.exists()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 04:01:31 28 4
gpt4 key购买 nike

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

ZooKeeperClient.exists介绍

暂无

代码示例

代码示例来源:origin: spotify/helios

private boolean parentExists() throws KeeperException {
 return client("parentExists").exists(path) != null;
}

代码示例来源:origin: spotify/helios

@Override
public Stat exists(String path) throws KeeperException {
 return reporter.time(tag, "exists", () -> client.exists(path));
}

代码示例来源:origin: spotify/helios

private boolean checkHostUp(final ZooKeeperClient client, final String host) {
 try {
  final Stat stat = client.exists(Paths.statusHostUp(host));
  return stat != null;
 } catch (KeeperException e) {
  throw new HeliosRuntimeException("getting host " + host + " up status failed", e);
 }
}

代码示例来源:origin: spotify/helios

public static boolean isHostRegistered(final ZooKeeperClient client, final String host) {
 try {
  final Stat stat = client.exists(Paths.configHostId(host));
  return stat != null;
 } catch (KeeperException e) {
  throw new HeliosRuntimeException("getting host " + host + " id failed", e);
 }
}

代码示例来源:origin: spotify/helios

/**
 * Returns a list of the host names of the currently running masters.
 */
@Override
public List<String> getRunningMasters() {
 final ZooKeeperClient client = provider.get("getRunningMasters");
 try {
  final List<String> masters = client.getChildren(Paths.statusMaster());
  final ImmutableList.Builder<String> upMasters = ImmutableList.builder();
  for (final String master : masters) {
   if (client.exists(Paths.statusMasterUp(master)) != null) {
    upMasters.add(master);
   }
  }
  return upMasters.build();
 } catch (KeeperException e) {
  throw new HeliosRuntimeException("listing masters failed", e);
 }
}

代码示例来源:origin: spotify/helios

final String hostInfoPath = Paths.statusHostInfo(name);
final Stat stat = client.exists(idPath);
if (stat == null) {
 log.debug("Agent id node not present, registering agent {}: {}", id, name);

代码示例来源:origin: spotify/helios

final List<ZooKeeperOperation> operations = Lists.newArrayList();
if (client.exists(Paths.configHost(host)) == null) {
 throw new HostNotFoundException("host [" + host + "] does not exist");
  operations.add(delete(node));
 if (client.exists(Paths.configJobHost(job, host)) != null) {
  operations.add(delete(Paths.configJobHost(job, host)));
if (client.exists(idPath) != null) {
 operations.add(delete(idPath));

代码示例来源:origin: spotify/helios

final Stat tasksStat = client.exists(tasksPath);
if (tasksStat != null) {
 operations.add(delete(tasksPath));

代码示例来源:origin: spotify/helios

if (client.exists(path) == null) {
 operations.add(create(path));

代码示例来源:origin: spotify/helios

events.add(eventFactory.rollingUpdateStarted(deploymentGroup));
final Stat tasksStat = client.exists(
  Paths.statusDeploymentGroupTasks(deploymentGroup.getName()));
if (tasksStat == null) {

代码示例来源:origin: spotify/helios

if (client.exists(creationPath) != null) {

代码示例来源:origin: spotify/helios

if (client.exists(taskCreationPath) != null) {

代码示例来源:origin: at.molindo/helios-services

private boolean parentExists() throws KeeperException {
 return client("parentExists").exists(path) != null;
 }

代码示例来源:origin: at.molindo/helios-services

@Override
public Stat exists(String path) throws KeeperException {
 try {
  return client.exists(path);
 } catch (KeeperException e) {
  reporter.checkException(e, tag, "exists");
  throw e;
 }
}

代码示例来源:origin: at.molindo/helios-services

private boolean checkHostUp(final ZooKeeperClient client, final String host) {
 try {
  final Stat stat = client.exists(Paths.statusHostUp(host));
  return stat != null;
 } catch (KeeperException e) {
  throw new HeliosRuntimeException("getting host " + host + " up status failed", e);
 }
}

代码示例来源:origin: at.molindo/helios-services

/**
 * Returns a list of the host names of the currently running masters.
 */
@Override
public List<String> getRunningMasters() {
 final ZooKeeperClient client = provider.get("getRunningMasters");
 try {
  final List<String> masters = client.getChildren(Paths.statusMaster());
  final ImmutableList.Builder<String> upMasters = ImmutableList.builder();
  for (final String master : masters) {
   if (client.exists(Paths.statusMasterUp(master)) != null) {
    upMasters.add(master);
   }
  }
  return upMasters.build();
 } catch (KeeperException e) {
  throw new HeliosRuntimeException("listing masters failed", e);
 }
}

代码示例来源:origin: at.molindo/helios-services

@Override
public void removeDeploymentGroup(final String name) throws DeploymentGroupDoesNotExistException {
 log.info("removing deployment-group: name={}", name);
 final ZooKeeperClient client = provider.get("removeDeploymentGroup");
 try {
  client.ensurePath(Paths.configDeploymentGroups());
  client.delete(Paths.configDeploymentGroup(name));
  if (client.exists(Paths.statusDeploymentGroupHosts(name)) != null) {
   client.delete(Paths.statusDeploymentGroupHosts(name));
  }
  if (client.exists(Paths.statusDeploymentGroup(name)) != null) {
   client.delete(Paths.statusDeploymentGroup(name));
  }
 } catch (final NoNodeException e) {
  throw new DeploymentGroupDoesNotExistException(name);
 } catch (final KeeperException e) {
  throw new HeliosRuntimeException("removing deployment-group " + name + " failed", e);
 }
}

代码示例来源:origin: at.molindo/helios-services

final String idPath = Paths.configHostId(name);
final Stat stat = client.exists(idPath);
if (stat == null) {
 log.debug("Agent id node not present, registering agent {}: {}", id, name);

代码示例来源:origin: at.molindo/helios-services

if (client.exists(creationPath) != null) {

代码示例来源:origin: at.molindo/helios-services

stat = client.exists(Paths.configHostId(host));
} catch (KeeperException e) {
 throw new HeliosRuntimeException("Failed to check host status", e);

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com