} finally { for (final TargetAndClient cc : clients) { cc.getClient().close();
showReport(out, exact, prefixes, jobIds, formatter, cc.getClient());
@Override int run(final Namespace options, final List<TargetAndClient> clients, final PrintStream out, final boolean json, final BufferedReader stdin) throws ExecutionException, InterruptedException, IOException { final boolean exact = options.getBoolean(exactArg.getDest()); final List<String> prefixes = options.getList(prefixesArg.getDest()); final String jobIdString = options.getString(jobsArg.getDest()); final List<ListenableFuture<Map<JobId, Job>>> jobIdFutures = Lists.newArrayList(); for (final TargetAndClient cc : clients) { jobIdFutures.add(cc.getClient().jobs(jobIdString)); } final Set<JobId> jobIds = Sets.newHashSet(); for (final ListenableFuture<Map<JobId, Job>> future : jobIdFutures) { jobIds.addAll(future.get().keySet()); } watchJobsOnHosts(out, exact, prefixes, jobIds, options.getInt(intervalArg.getDest()), clients); return 0; }
} finally { for (TargetAndClient cc : clients) { cc.getClient().close();
showReport(out, exact, prefixes, jobIds, formatter, cc.getClient());
@Override int run(final Namespace options, final List<TargetAndClient> clients, final PrintStream out, final boolean json, final BufferedReader stdin) throws ExecutionException, InterruptedException, IOException { final boolean exact = options.getBoolean(exactArg.getDest()); final List<String> prefixes = options.getList(prefixesArg.getDest()); final String jobIdString = options.getString(jobsArg.getDest()); final List<ListenableFuture<Map<JobId, Job>>> jobIdFutures = Lists.newArrayList(); for (final TargetAndClient cc : clients) { jobIdFutures.add(cc.getClient().jobs(jobIdString)); } final Set<JobId> jobIds = Sets.newHashSet(); for (final ListenableFuture<Map<JobId, Job>> future : jobIdFutures) { jobIds.addAll(future.get().keySet()); } watchJobsOnHosts(out, exact, prefixes, jobIds, options.getInt(intervalArg.getDest()), clients); return 0; }