Examples of FlumeMasterCommandThrift


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

    // Spawn the logical node on our local physical node.
    List<String> args = new ArrayList<String>();
    args.add(mPhysicalNodeName);
    args.add(logicalNode);
    FlumeMasterCommandThrift cmd = new FlumeMasterCommandThrift("spawn", args);
    submitCommand(cmd);
  }
View Full Code Here

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

    List<String> args = new ArrayList<String>();
    args.add(logicalNode);
    args.add(source);
    args.add(sink);
    LOG.info("Configuring logical node: " + logicalNode + " : " + source + " -> " + sink);
    FlumeMasterCommandThrift cmd = new FlumeMasterCommandThrift("config", args);
    submitCommand(cmd);
  }
View Full Code Here

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

  }

  public void decommissionLogicalNode(String logicalNode) throws TException {
    List<String> args = new ArrayList<String>();
    args.add(logicalNode);
    FlumeMasterCommandThrift cmd = new FlumeMasterCommandThrift("decommission", args);
    submitCommand(cmd);
  }
View Full Code Here

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

  /**
   * Convert from a { @link Command } object to a { @link
   * FlumeMasterCommandThrift } object.
   */
  public static FlumeMasterCommandThrift commandToThrift(Command cmd) {
    FlumeMasterCommandThrift out = new FlumeMasterCommandThrift();
    out.command = cmd.command;
    out.arguments = new LinkedList<String>();
    for (String s : cmd.args) {
      out.arguments.add(s);
    }
View Full Code Here

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

  @Override
  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

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

      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

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

  }

  @Test
  public void testThriftCommandConversion() {
    Command start = new Command("here", "is", "a", "command");
    FlumeMasterCommandThrift middle = MasterAdminServerThrift.commandToThrift(start);
    assertEquals("here", middle.command.toString());
    assertEquals(3, middle.arguments.size());
    int index = 0;
    for (String s: middle.arguments) {
      switch(index) {
View Full Code Here

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

  }
 
  @Test
  public void testEmptyArgsCommandThrift() {
    Command start = new Command("ls");
    FlumeMasterCommandThrift middle = MasterAdminServerThrift.commandToThrift(start);
    assertEquals("ls", middle.command.toString());
    assertEquals(0, middle.arguments.size());
    Command end = MasterAdminServerThrift.commandFromThrift(middle);
    assertEquals("ls", end.getCommand());
    assertEquals(0, end.getArgs().length);
View Full Code Here

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

    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) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.