Examples of FlumeMasterCommandAvro


Examples of com.cloudera.flume.conf.avro.FlumeMasterCommandAvro

        l.add("arg2");
        CommandStatusAvro csa = new CommandStatusAvro();
        csa.cmdId = cmdid;
        csa.state = CommandStatus.State.SUCCEEDED.toString();
        csa.message = "message";
        csa.cmd = new FlumeMasterCommandAvro();
        csa.cmd.command = "cmd";
        csa.cmd.arguments = l;
        return csa;
      }
      return null;
View Full Code Here

Examples of com.cloudera.flume.conf.avro.FlumeMasterCommandAvro

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

Examples of com.cloudera.flume.conf.avro.FlumeMasterCommandAvro

  @Override
  public CommandStatusAvro getCmdStatus(long cmdid) throws AvroRemoteException {
    CommandStatus cmd = delegate.getCommandStatus(cmdid);
    Command c = cmd.getCommand();
    FlumeMasterCommandAvro fmca = new FlumeMasterCommandAvro();
    fmca.command = c.getCommand();
    List<CharSequence> l = new ArrayList<CharSequence>();
    for (String s : c.getArgs()) {
      l.add(s);
    }
View Full Code Here

Examples of com.cloudera.flume.conf.avro.FlumeMasterCommandAvro

  }

  @Test
  public void testAvroCommandConversion() {
    Command start = new Command("here", "is", "a", "command");
    FlumeMasterCommandAvro middle = MasterAdminServerAvro.commandToAvro(start);
    assertEquals("here", middle.command.toString());
    assertEquals(3, middle.arguments.size());
    int index = 0;
    for (CharSequence u : middle.arguments) {
      switch (index) {
View Full Code Here

Examples of com.cloudera.flume.conf.avro.FlumeMasterCommandAvro

  }

  @Test
  public void testEmptyArgsCommandAvro() {
    Command start = new Command("ls");
    FlumeMasterCommandAvro middle = MasterAdminServerAvro.commandToAvro(start);
    assertEquals("ls", middle.command.toString());
    assertEquals(0, middle.arguments.size());
    Command end = MasterAdminServerAvro.commandFromAvro(middle);
    assertEquals("ls", end.getCommand());
    assertEquals(0, end.getArgs().length);
View Full Code Here

Examples of com.cloudera.flume.conf.avro.FlumeMasterCommandAvro

  public CommandStatus getCommandStatus(long cmdid) throws IOException {
    CommandStatusAvro csa = masterClient.getCmdStatus(cmdid);
    if (csa == null) {
      throw new IOException("Invalid command id: " + cmdid);
    }
    FlumeMasterCommandAvro cmda = csa.cmd;
    List<String> args = new ArrayList<String>();
    for (CharSequence cs : cmda.arguments) {
      args.add(cs.toString());
    }
    Command cmd = new Command(cmda.command.toString(), args
View Full Code Here

Examples of com.cloudera.flume.conf.avro.FlumeMasterCommandAvro

        l.add("arg2");
        CommandStatusAvro csa = new CommandStatusAvro();
        csa.cmdId = cmdid;
        csa.state = CommandStatus.State.SUCCEEDED.toString();
        csa.message = "message";
        csa.cmd = new FlumeMasterCommandAvro();
        csa.cmd.command = "cmd";
        csa.cmd.arguments = l;
        return csa;
      }
      return null;
View Full Code Here

Examples of com.cloudera.flume.conf.avro.FlumeMasterCommandAvro

  public CommandStatus getCommandStatus(long cmdid) throws IOException {
    CommandStatusAvro csa = masterClient.getCmdStatus(cmdid);
    if (csa == null) {
      throw new IOException("Invalid command id: " + cmdid);
    }
    FlumeMasterCommandAvro cmda = csa.cmd;
    List<String> args = new ArrayList<String>();
    for (CharSequence cs : cmda.arguments) {
      args.add(cs.toString());
    }
    Command cmd = new Command(cmda.command.toString(), args
View Full Code Here

Examples of com.cloudera.flume.conf.avro.FlumeMasterCommandAvro

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

Examples of com.cloudera.flume.conf.avro.FlumeMasterCommandAvro

  @Override
  public CommandStatusAvro getCmdStatus(long cmdid) throws AvroRemoteException {
    CommandStatus cmd = delegate.getCommandStatus(cmdid);
    Command c = cmd.getCommand();
    FlumeMasterCommandAvro fmca = new FlumeMasterCommandAvro();
    fmca.command = c.getCommand();
    List<CharSequence> l = new ArrayList<CharSequence>();
    for (String s : c.getArgs()) {
      l.add(s);
    }
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.