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; }
private void assertJobExists(final ZooKeeperClient client, final JobId id) throws JobDoesNotExistException { try { final String path = Paths.configJob(id); if (client.stat(path) == null) { throw new JobDoesNotExistException(id); } } catch (KeeperException e) { throw new HeliosRuntimeException("checking job existence failed", e); } }
final Job descriptor = getJob(jobId); if (descriptor == null) { throw new JobDoesNotExistException(jobId);
final Job job = getJob(client, id); if (job == null) { throw new JobDoesNotExistException(id); client.transaction(operations.build()); } catch (final NoNodeException e) { throw new JobDoesNotExistException(id); } catch (final NotEmptyException e) { throw new JobStillDeployedException(id, listJobHosts(client, id));
throw new JobDoesNotExistException(jobId);
throw new JobDoesNotExistException(id);
throw new JobDoesNotExistException(id);
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; }
private void assertJobExists(final ZooKeeperClient client, final JobId id) throws JobDoesNotExistException { try { final String path = Paths.configJob(id); if (client.stat(path) == null) { throw new JobDoesNotExistException(id); } } catch (KeeperException e) { throw new HeliosRuntimeException("checking job existence failed", e); } }
final Job descriptor = getJob(jobId); if (descriptor == null) { throw new JobDoesNotExistException(jobId);
final Job job = getJob(client, id); if (job == null) { throw new JobDoesNotExistException(id); client.transaction(operations.build()); } catch (final NoNodeException e) { throw new JobDoesNotExistException(id); } catch (final NotEmptyException e) { throw new JobStillDeployedException(id, listJobHosts(client, id));
throw new JobDoesNotExistException(id);
throw new JobDoesNotExistException(jobId);
throw new JobDoesNotExistException(id);