- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperClient.getData()
方法的一些代码示例,展示了ZooKeeperClient.getData()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperClient.getData()
方法的具体详情如下:
包路径:com.spotify.helios.servicescommon.coordination.ZooKeeperClient
类名称:ZooKeeperClient
方法名:getData
暂无
代码示例来源:origin: spotify/helios
@Override
public byte[] getData(String path) throws KeeperException {
return reporter.time(tag, "getData", () -> client.getData(path));
}
代码示例来源:origin: spotify/helios
private <T> T tryGetEntity(final ZooKeeperClient client, String path, TypeReference<T> type,
String name) {
try {
final byte[] data = client.getData(path);
return Json.read(data, type);
} catch (NoNodeException e) {
return null;
} catch (KeeperException | IOException e) {
throw new HeliosRuntimeException("reading " + name + " info failed", e);
}
}
代码示例来源:origin: spotify/helios
@Nullable
private TaskStatus getTaskStatus(final ZooKeeperClient client, final String host,
final JobId jobId) {
final String containerPath = Paths.statusHostJob(host, jobId);
try {
final byte[] data = client.getData(containerPath);
return parse(data, TaskStatus.class);
} catch (NoNodeException ignored) {
return null;
} catch (KeeperException | IOException e) {
throw new HeliosRuntimeException("Getting task " + jobId + " status "
+ "for host " + host + " failed", e);
}
}
代码示例来源:origin: spotify/helios
private Job getJob(final ZooKeeperClient client, final JobId id) {
final String path = Paths.configJob(id);
try {
final byte[] data = client.getData(path);
return Json.read(data, Job.class);
} catch (NoNodeException e) {
// Return null to indicate that the job does not exist
return null;
} catch (KeeperException | IOException e) {
throw new HeliosRuntimeException("getting job " + id + " failed", e);
}
}
代码示例来源:origin: spotify/helios
private void assertHostExists(final ZooKeeperClient client, final String host)
throws HostNotFoundException {
try {
client.getData(Paths.configHost(host));
} catch (NoNodeException e) {
throw new HostNotFoundException(host, e);
} catch (KeeperException e) {
throw new HeliosRuntimeException(e);
}
}
代码示例来源:origin: spotify/helios
private void assertTaskExists(final ZooKeeperClient client, final String host, final JobId jobId)
throws JobNotDeployedException {
try {
client.getData(Paths.configHostJob(host, jobId));
} catch (NoNodeException e) {
throw new JobNotDeployedException(host, jobId);
} catch (KeeperException e) {
throw new HeliosRuntimeException(e);
}
}
代码示例来源:origin: spotify/helios
for (final String node : nodes) {
final String nodePath = ZKPaths.makePath(path, node);
final byte[] data = client.getData(nodePath);
remote.put(node, data);
代码示例来源:origin: spotify/helios
private DeploymentGroup getDeploymentGroup(final ZooKeeperClient client, final String name)
throws DeploymentGroupDoesNotExistException {
try {
final byte[] data = client.getData(Paths.configDeploymentGroup(name));
return Json.read(data, DeploymentGroup.class);
} catch (NoNodeException e) {
throw new DeploymentGroupDoesNotExistException(name);
} catch (KeeperException | IOException e) {
throw new HeliosRuntimeException("getting deployment-group " + name + " failed", e);
}
}
代码示例来源:origin: spotify/helios
final byte[] data = client.getData(Paths.historyJobHostEventsTimestamp(
jobId, h, Long.valueOf(event)));
final TaskStatus status = Json.read(data, TaskStatus.class);
代码示例来源:origin: spotify/helios
final String path = Paths.configDeploymentGroup(name);
try {
final byte[] data = client.getData(path);
final DeploymentGroup descriptor = parse(data, DeploymentGroup.class);
descriptors.put(descriptor.getName(), descriptor);
代码示例来源:origin: spotify/helios
final String path = Paths.configJob(jobId);
try {
final byte[] data = client.getData(path);
final Job descriptor = parse(data, Job.class);
descriptors.put(descriptor.getId(), descriptor);
代码示例来源:origin: spotify/helios
ZooKeeperRegistrarUtil.registerHost(client, idPath, name, id);
} else {
final byte[] bytes = client.getData(idPath);
final String existingId = bytes == null ? "" : new String(bytes, UTF_8);
if (!id.equals(existingId)) {
代码示例来源: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
private static void checkForPortConflicts(final ZooKeeperClient client,
final String host,
final int port,
final JobId jobId)
throws JobPortAllocationConflictException {
try {
final String path = Paths.configHostPort(host, port);
if (client.stat(path) == null) {
return;
}
final byte[] b = client.getData(path);
final JobId existingJobId = parse(b, JobId.class);
throw new JobPortAllocationConflictException(jobId, existingJobId, host, port);
} catch (KeeperException | IOException ex) {
throw new HeliosRuntimeException("checking port allocations failed", ex);
}
}
代码示例来源:origin: spotify/helios
/**
* Returns the current deployment state of {@code jobId} on {@code host}.
*/
@Override
public Deployment getDeployment(final String host, final JobId jobId) {
final String path = Paths.configHostJob(host, jobId);
final ZooKeeperClient client = provider.get("getDeployment");
try {
final byte[] data = client.getData(path);
final Task task = parse(data, Task.class);
return Deployment.of(jobId, task.getGoal(), task.getDeployerUser(), task.getDeployerMaster(),
task.getDeploymentGroupName());
} catch (KeeperException.NoNodeException e) {
return null;
} catch (KeeperException | IOException e) {
throw new HeliosRuntimeException("getting deployment failed", e);
}
}
代码示例来源:origin: at.molindo/helios-services
@Override
public byte[] getData(String path) throws KeeperException {
try {
return client.getData(path);
} catch (KeeperException e) {
reporter.checkException(e, tag, "getData");
throw e;
}
}
代码示例来源:origin: at.molindo/helios-services
private <T> T tryGetEntity(final ZooKeeperClient client, String path, TypeReference<T> type,
String name) {
try {
final byte[] data = client.getData(path);
return Json.read(data, type);
} catch (NoNodeException e) {
return null;
} catch (KeeperException | IOException e) {
throw new HeliosRuntimeException("reading " + name + " info failed", e);
}
}
代码示例来源:origin: at.molindo/helios-services
private void assertHostExists(final ZooKeeperClient client, final String host)
throws HostNotFoundException {
try {
client.getData(Paths.configHost(host));
} catch (NoNodeException e) {
throw new HostNotFoundException(host, e);
} catch (KeeperException e) {
throw new HeliosRuntimeException(e);
}
}
代码示例来源:origin: at.molindo/helios-services
private Job getJob(final ZooKeeperClient client, final JobId id) {
final String path = Paths.configJob(id);
try {
final byte[] data = client.getData(path);
return Json.read(data, Job.class);
} catch (NoNodeException e) {
// Return null to indicate that the job does not exist
return null;
} catch (KeeperException | IOException e) {
throw new HeliosRuntimeException("getting job " + id + " failed", e);
}
}
代码示例来源:origin: at.molindo/helios-services
private DeploymentGroup getDeploymentGroup(final ZooKeeperClient client, final String name)
throws DeploymentGroupDoesNotExistException {
try {
final byte[] data = client.getData(Paths.configDeploymentGroup(name));
return Json.read(data, DeploymentGroup.class);
} catch (NoNodeException e) {
throw new DeploymentGroupDoesNotExistException(name);
} catch (KeeperException | IOException e) {
throw new HeliosRuntimeException("getting deployment-group " + name + " failed", e);
}
}
本文整理了Java中com.spotify.helios.servicescommon.ZooKeeperRegistrar类的一些代码示例,展示了ZooKeeperRegistrar类的具体用法。这
本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperClient类的一些代码示例,展示了ZooKeeperClient类
本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperClientProvider类的一些代码示例,展示了ZooKeepe
本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperModelReporter类的一些代码示例,展示了ZooKeeper
本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperOperations类的一些代码示例,展示了ZooKeeperOpe
本文整理了Java中com.spotify.helios.servicescommon.statistics.ZooKeeperMetricsImpl类的一些代码示例,展示了ZooKeeperMetr
本文整理了Java中com.spotify.helios.servicescommon.statistics.ZooKeeperMetrics类的一些代码示例,展示了ZooKeeperMetrics类
本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperUpdatingPersistentDirectory类的一些代码示
本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperNodeUpdater类的一些代码示例,展示了ZooKeeperNo
本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperOperation类的一些代码示例,展示了ZooKeeperOper
本文整理了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
本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperClient.createWithMode()方法的一些代码示例,展
本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperClient.exists()方法的一些代码示例,展示了ZooKee
本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperClient.getData()方法的一些代码示例,展示了ZooKe
本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperClient.getChildren()方法的一些代码示例,展示了Z
本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperClient.listRecursive()方法的一些代码示例,展示
本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperClient.persistentEphemeralNode()方法
本文整理了Java中com.spotify.helios.servicescommon.coordination.ZooKeeperClient.getCuratorFramework()方法的一些代
我是一名优秀的程序员,十分优秀!