@Override public Collection<CuratorTransactionResult> transaction(ZooKeeperOperation... operations) throws KeeperException { return reporter.time(tag, "transaction", () -> client.transaction(operations)); }
@Override public Collection<CuratorTransactionResult> transaction(List<ZooKeeperOperation> operations) throws KeeperException { return reporter.time(tag, "transaction", () -> client.transaction(operations)); }
client.transaction(ops); emitEvents(deploymentGroupEventTopic, op.events()); } catch (BadVersionException e) {
operations.add(create(Paths.configHostId(host), hostId.getBytes(UTF_8))); client.transaction(operations); } catch (NoNodeException e) { throw new HostNotFoundException(host);
client.transaction(delete(nodes));
client.transaction(operations.build()); } catch (final NoNodeException e) { throw new JobDoesNotExistException(id);
client.transaction(operations); } catch (NoNodeException e) { throw new HostNotFoundException(host);
client.transaction(operations); } catch (final NoNodeException e) {
client.transaction(operations); } catch (final NoNodeException e) { throw new DeploymentGroupDoesNotExistException(name);
deploymentGroup.getName(), jobId, operations); client.transaction(operations);
try { client.ensurePath(Paths.historyJob(id)); client.transaction(create(Paths.configJob(id), job), create(Paths.configJobRefShort(id), id), create(Paths.configJobHosts(id)),
groupName, deploymentGroup.getJobId(), ops); client.transaction(ops); emitEvents(deploymentGroupEventTopic, events); } catch (BadVersionException e) {
client.ensurePath(Paths.configDeploymentGroups()); client.ensurePath(Paths.statusDeploymentGroups()); client.transaction( create(Paths.configDeploymentGroup(deploymentGroup.getName()), deploymentGroup), create(Paths.statusDeploymentGroup(deploymentGroup.getName())),
client.transaction(operations); log.info("deployed {}: {} (retry={})", deployment, host, count); } catch (NoNodeException e) {
@Override public Collection<CuratorTransactionResult> transaction(ZooKeeperOperation... operations) throws KeeperException { try { return client.transaction(operations); } catch (KeeperException e) { reporter.checkException(e, tag, "transaction"); throw e; } }
@Override public Collection<CuratorTransactionResult> transaction(List<ZooKeeperOperation> operations) throws KeeperException { try { return client.transaction(operations); } catch (KeeperException e) { reporter.checkException(e, tag, "transaction"); throw e; } }
client.transaction(delete(nodes));
@Override public void stopDeploymentGroup(final String deploymentGroupName) throws DeploymentGroupDoesNotExistException { checkNotNull(deploymentGroupName, "name"); log.info("stop deployment-group: name={}", deploymentGroupName); final ZooKeeperClient client = provider.get("stopDeploymentGroup"); final DeploymentGroup deploymentGroup = getDeploymentGroup(deploymentGroupName); final String statusPath = Paths.statusDeploymentGroup(deploymentGroupName); final DeploymentGroupStatus status = DeploymentGroupStatus.newBuilder() .setDeploymentGroup(deploymentGroup) .setState(FAILED) .setError("Stopped by user") .build(); try { client.ensurePath(statusPath); client.transaction(set(statusPath, status)); } catch (final NoNodeException e) { throw new DeploymentGroupDoesNotExistException(deploymentGroupName); } catch (final KeeperException e) { throw new HeliosRuntimeException( "stop deployment-group " + deploymentGroupName + " failed", e); } }
try { client.ensurePath(Paths.historyJob(id)); client.transaction(create(Paths.configJob(id), job), create(Paths.configJobRefShort(id), id), create(Paths.configJobHosts(id)),
@Override public void addDeploymentGroup(final DeploymentGroup deploymentGroup) throws DeploymentGroupExistsException { log.info("adding deployment-group: {}", deploymentGroup); final ZooKeeperClient client = provider.get("addDeploymentGroup"); try { try { client.ensurePath(Paths.configDeploymentGroups()); client.ensurePath(Paths.statusDeploymentGroups()); client.transaction( create(Paths.configDeploymentGroup(deploymentGroup.getName()), deploymentGroup), create(Paths.statusDeploymentGroup(deploymentGroup.getName())), create(Paths.statusDeploymentGroupHosts(deploymentGroup.getName())) ); } catch (final NodeExistsException e) { throw new DeploymentGroupExistsException(deploymentGroup.getName()); } } catch (final KeeperException e) { throw new HeliosRuntimeException("adding deployment-group " + deploymentGroup + " failed", e); } }