Example #1
0
  @Override
  protected int runWithJobId(
      final Namespace options,
      final HeliosClient client,
      final PrintStream out,
      final boolean json,
      final JobId jobId)
      throws ExecutionException, InterruptedException, IOException {
    final List<String> hosts = options.getList(hostsArg.getDest());

    final Deployment deployment =
        new Deployment.Builder().setGoal(Goal.STOP).setJobId(jobId).build();

    out.printf("Stopping %s on %s%n", jobId, hosts);

    int code = 0;

    for (final String host : hosts) {
      out.printf("%s: ", host);
      final SetGoalResponse result = client.setGoal(deployment, host).get();
      if (result.getStatus() == SetGoalResponse.Status.OK) {
        out.printf("done%n");
      } else {
        out.printf("failed: %s%n", result);
        code = 1;
      }
    }

    return code;
  }
Example #2
0
 List<File> getConfigFiles() {
   return options.getList("config_file");
 }
 public List<String> getKafkaBrokers() {
   final List<String> kafkaBrokers = options.getList(kafkaArg.getDest());
   return kafkaBrokers.isEmpty() ? null : kafkaBrokers;
 }