Package com.cloudera.flume.conf.thrift

Examples of com.cloudera.flume.conf.thrift.CommandStatusThrift


  public CommandStatusThrift getCmdStatus(long cmdid) throws TException {
    CommandStatus cmd = delegate.getCommandStatus(cmdid);
    Command c = cmd.getCommand();
    FlumeMasterCommandThrift fmct = new FlumeMasterCommandThrift(
        c.getCommand(), Arrays.asList(c.getArgs()));
    CommandStatusThrift cst = new CommandStatusThrift(cmd.getCmdID(), cmd
        .getState().toString(), cmd.getMessage(), fmct);
    return cst;
  }
View Full Code Here


    public CommandStatusThrift getCmdStatus(long cmdid) throws TException {
      if (cmdid == 1337) {
        List<String> l = new ArrayList<String>();
        l.add("arg1");
        l.add("arg2");
        return new CommandStatusThrift(cmdid, CommandStatus.State.SUCCEEDED
            .toString(), "message", new FlumeMasterCommandThrift("cmd", l));
      }
      return null;
    }
View Full Code Here

  }

  @Override
  public CommandStatus getCommandStatus(long cmdid) throws IOException {
    try {
      CommandStatusThrift cst = masterClient.getCmdStatus(cmdid);
      if (cst == null) {
        throw new IOException("Illegal command id: " + cmdid);
      }
      FlumeMasterCommandThrift cmdt = cst.getCmd();
      Command cmd = new Command(cmdt.getCommand(), cmdt.arguments
          .toArray(new String[0]));
      CommandStatus cs = new CommandStatus(cst.getCmdId(), cmd,
          CommandStatus.State.valueOf(cst.state), cst.getMessage());
      return cs;
    } catch (TException e) {
      throw new IOException(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.cloudera.flume.conf.thrift.CommandStatusThrift

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.