- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperClient.getChildren()
方法的一些代码示例,展示了ZooKeeperClient.getChildren()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperClient.getChildren()
方法的具体详情如下:
包路径:com.spotify.helios.servicescommon.coordination.ZooKeeperClient
类名称:ZooKeeperClient
方法名:getChildren
暂无
代码示例来源:origin: spotify/helios
private static List<String> safeGetChildren(final ZooKeeperClient client, final String path) {
try {
return client.getChildren(path);
} catch (KeeperException ignore) {
return ImmutableList.of();
}
}
代码示例来源:origin: spotify/helios
@Override
Iterable<String> collectItems() {
final String path = Paths.historyJobs();
List<String> jobIds = Collections.emptyList();
try {
jobIds = client.getChildren(path);
} catch (KeeperException e) {
log.warn("Failed to get children of znode {}", path, e);
}
return jobIds;
}
代码示例来源:origin: spotify/helios
@Override
public List<String> getChildren(String path) throws KeeperException {
return reporter.time(tag, "getChildren", () -> client.getChildren(path));
}
代码示例来源:origin: spotify/helios
private List<JobId> listHostJobs(final ZooKeeperClient client, final String host) {
final List<String> jobIdStrings;
final String folder = Paths.statusHostJobs(host);
try {
jobIdStrings = client.getChildren(folder);
} catch (KeeperException.NoNodeException e) {
return null;
} catch (KeeperException e) {
throw new HeliosRuntimeException("List tasks for host failed: " + host, e);
}
final ImmutableList.Builder<JobId> jobIds = ImmutableList.builder();
for (final String jobIdString : jobIdStrings) {
jobIds.add(JobId.fromString(jobIdString));
}
return jobIds.build();
}
代码示例来源:origin: spotify/helios
/**
* Returns a list of the hosts/agents that have been registered.
*/
@Override
public List<String> listHosts() {
try {
// TODO (dano): only return hosts whose agents completed registration (i.e. has id nodes)
return provider.get("listHosts").getChildren(Paths.configHosts());
} catch (KeeperException.NoNodeException e) {
return emptyList();
} catch (KeeperException e) {
throw new HeliosRuntimeException("listing hosts failed", e);
}
}
代码示例来源:origin: spotify/helios
static void initializeAclRecursive(final ZooKeeperClient client, final String path,
final ACLProvider aclProvider)
throws KeeperException {
try {
final List<ACL> expected = aclProvider.getAclForPath(path);
final List<ACL> actual = client.getAcl(path);
if (newHashSet(expected).equals(newHashSet(actual))) {
// actual ACL matches expected
} else {
client.setAcl(path, expected);
}
for (final String child : client.getChildren(path)) {
initializeAclRecursive(client, path.replaceAll("/$", "") + "/" + child, aclProvider);
}
} catch (Exception e) {
throwIfInstanceOf(e, KeeperException.class);
throw new RuntimeException(e);
}
}
}
代码示例来源:origin: spotify/helios
private List<String> listJobHosts(final ZooKeeperClient client, final JobId jobId)
throws JobDoesNotExistException {
final List<String> hosts;
try {
hosts = client.getChildren(Paths.configJobHosts(jobId));
} catch (NoNodeException e) {
throw new JobDoesNotExistException(jobId);
} catch (KeeperException e) {
throw new HeliosRuntimeException("failed to list hosts for job: " + jobId, e);
}
return hosts;
}
代码示例来源:origin: spotify/helios
private UUID getJobCreation(final ZooKeeperClient client, final JobId id)
throws KeeperException {
final String parent = Paths.configHostJobCreationParent(id);
final List<String> children = client.getChildren(parent);
for (final String child : children) {
if (Paths.isConfigJobCreation(child)) {
return Paths.configJobCreationId(child);
}
}
return null;
}
代码示例来源:origin: spotify/helios
private void syncChecked() throws KeeperException {
final ZooKeeperClient client = client("sync");
final List<String> nodes = client.getChildren(path);
final Map<String, byte[]> snapshot = entries.get();
代码示例来源: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
client.getChildren(Paths.historyJobHosts(jobId));
} catch (NoNodeException e) {
return emptyList();
final List<String> events;
try {
events = client.getChildren(Paths.historyJobHostEvents(jobId, h));
} catch (NoNodeException e) {
continue;
代码示例来源:origin: spotify/helios
final List<String> names;
try {
names = client.getChildren(folder);
} catch (NoNodeException e) {
return Maps.newHashMap();
代码示例来源:origin: spotify/helios
final List<String> ids;
try {
ids = client.getChildren(folder);
} catch (NoNodeException e) {
return Maps.newHashMap();
代码示例来源:origin: spotify/helios
final List<String> names;
try {
names = client.getChildren(folder);
} catch (NoNodeException e) {
return Collections.emptyMap();
代码示例来源:origin: spotify/helios
private Map<JobId, Deployment> getTasks(final ZooKeeperClient client, final String host) {
final Map<JobId, Deployment> jobs = Maps.newHashMap();
try {
final String folder = Paths.configHostJobs(host);
final List<String> jobIds;
try {
jobIds = client.getChildren(folder);
} catch (KeeperException.NoNodeException e) {
log.warn("Unable to get deployment config for {}", host, e);
return ImmutableMap.of();
}
for (final String jobIdString : jobIds) {
final JobId jobId = JobId.fromString(jobIdString);
final String containerPath = Paths.configHostJob(host, jobId);
try {
final byte[] data = client.getData(containerPath);
final Task task = parse(data, Task.class);
jobs.put(jobId, Deployment.of(jobId, task.getGoal(), task.getDeployerUser(),
task.getDeployerMaster(), task.getDeploymentGroupName()));
} catch (KeeperException.NoNodeException ignored) {
log.debug("deployment config node disappeared: {}", jobIdString);
}
}
} catch (KeeperException | IOException e) {
throw new HeliosRuntimeException("getting deployment config failed", e);
}
return jobs;
}
代码示例来源:origin: spotify/helios
final List<String> events = client.getChildren(Paths.historyJobHostEvents(jobId, hostname));
if (events.size() > MAX_NUMBER_STATUS_EVENTS_TO_RETAIN) {
trimStatusEvents(events, jobId);
代码示例来源:origin: at.molindo/helios-services
private List<String> safeGetChildren(final ZooKeeperClient client, final String path) {
try {
return client.getChildren(path);
} catch (KeeperException ignore) {
return ImmutableList.of();
}
}
代码示例来源:origin: at.molindo/helios-services
@Override
public List<String> getChildren(String path) throws KeeperException {
try {
return client.getChildren(path);
} catch (KeeperException e) {
reporter.checkException(e, tag, "getChildren");
throw e;
}
}
代码示例来源:origin: at.molindo/helios-services
private List<String> listJobHosts(final ZooKeeperClient client, final JobId jobId)
throws JobDoesNotExistException {
final List<String> hosts;
try {
hosts = client.getChildren(Paths.configJobHosts(jobId));
} catch (NoNodeException e) {
throw new JobDoesNotExistException(jobId);
} catch (KeeperException e) {
throw new HeliosRuntimeException("failed to list hosts for job: " + jobId, e);
}
return hosts;
}
代码示例来源:origin: at.molindo/helios-services
private UUID getJobCreation(final ZooKeeperClient client, final JobId id)
throws KeeperException {
final String parent = Paths.configHostJobCreationParent(id);
final List<String> children = client.getChildren(parent);
for (final String child : children) {
if (Paths.isConfigJobCreation(id, parent, child)) {
return Paths.configJobCreationId(id, parent, child);
}
}
return null;
}
本文整理了Java中kafka.zookeeper.ZooKeeperClient.waitUntilConnected()方法的一些代码示例,展示了ZooKeeperClient.waitUntil
本文整理了Java中kafka.zookeeper.ZooKeeperClient.()方法的一些代码示例,展示了ZooKeeperClient.()的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中com.twitter.common.zookeeper.ZooKeeperClient.()方法的一些代码示例,展示了ZooKeeperClient.()的具体用法。这些代码示例
本文整理了Java中com.twitter.common.zookeeper.ZooKeeperClient.registerExpirationHandler()方法的一些代码示例,展示了ZooKe
本文整理了Java中com.twitter.common.zookeeper.ZooKeeperClient.digestCredentials()方法的一些代码示例,展示了ZooKeeperClie
本文整理了Java中com.twitter.common.zookeeper.ZooKeeperClient.unregister()方法的一些代码示例,展示了ZooKeeperClient.unre
本文整理了Java中com.twitter.common.zookeeper.ZooKeeperClient.get()方法的一些代码示例,展示了ZooKeeperClient.get()的具体用法。
本文整理了Java中com.twitter.common.zookeeper.ZooKeeperClient.close()方法的一些代码示例,展示了ZooKeeperClient.close()的具
本文整理了Java中com.twitter.common.zookeeper.ZooKeeperClient.shouldRetry()方法的一些代码示例,展示了ZooKeeperClient.sho
本文整理了Java中org.apache.bookkeeper.zookeeper.ZooKeeperClient.newBuilder()方法的一些代码示例,展示了ZooKeeperClient.n
本文整理了Java中org.apache.dubbo.remoting.zookeeper.ZookeeperClient.addStateListener()方法的一些代码示例,展示了Zookeep
本文整理了Java中org.apache.dubbo.remoting.zookeeper.ZookeeperClient.getChildren()方法的一些代码示例,展示了ZookeeperCli
本文整理了Java中org.apache.dubbo.remoting.zookeeper.ZookeeperClient.isConnected()方法的一些代码示例,展示了ZookeeperCli
本文整理了Java中org.apache.dubbo.remoting.zookeeper.ZookeeperClient.removeChildListener()方法的一些代码示例,展示了Zook
本文整理了Java中org.apache.dubbo.remoting.zookeeper.ZookeeperClient.addChildListener()方法的一些代码示例,展示了Zookeep
本文整理了Java中org.apache.dubbo.remoting.zookeeper.ZookeeperClient.delete()方法的一些代码示例,展示了ZookeeperClient.d
本文整理了Java中org.apache.dubbo.remoting.zookeeper.ZookeeperClient.create()方法的一些代码示例,展示了ZookeeperClient.c
本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperClient.getNode()方法的一些代码示例,展示了ZooKe
本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperClient.close()方法的一些代码示例,展示了ZooKeep
本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperClient.transaction()方法的一些代码示例,展示了Z
我是一名优秀的程序员,十分优秀!