Examples of GenericOptionsParser


Examples of org.apache.hadoop.util.GenericOptionsParser

  }


  public int run(String[] args) throws Exception {
    Configuration conf = getConf();
    args = new GenericOptionsParser(conf, args).getRemainingArgs();

    String serverUri = args[0];
    String inputDir = args[1];
    String tableName = args[2];
    String outputDir = args[3];
View Full Code Here

Examples of org.apache.hadoop.util.GenericOptionsParser

    .create("extrafiles");
   
    opts.addOption(logFiles);
    opts.addOption(extraFiles);
   
    GenericOptionsParser parser =
      new GenericOptionsParser(this.getConf(), opts, args);
   
    String[] remainingArgs = parser.getRemainingArgs();
    if (remainingArgs.length != 1) {
      usage();
      return -1;
    }
    if (remainingArgs[0].compareTo("check") == 0) {
      this.readOnly = true;
    } else if (remainingArgs[0].compareTo("upgrade") != 0) {
      usage();
      return -1;
    }

    if (readOnly) {
      this.logFiles = ACTION.IGNORE;
      this.otherFiles = ACTION.IGNORE;

    } else {
      CommandLine commandLine = parser.getCommandLine();

      ACTION action = null;
      if (commandLine.hasOption("logfiles")) {
        action = options.get(commandLine.getOptionValue("logfiles"));
        if (action == null) {
View Full Code Here

Examples of org.apache.hadoop.util.GenericOptionsParser

    if (conf == null)
      conf = new HdfsConfiguration();
   
    if (args != null) {
      // parse generic hadoop options
      GenericOptionsParser hParser = new GenericOptionsParser(conf, args);
      args = hParser.getRemainingArgs();
    }
   
    if (!parseArguments(args, conf)) {
      printUsage(System.err);
      return null;
View Full Code Here

Examples of org.apache.hadoop.util.GenericOptionsParser

        "Name of the delegation token renewer");
    fetcherOptions.addOption(CANCEL, false, "cancel the token");
    fetcherOptions.addOption(RENEW, false, "renew the token");
    fetcherOptions.addOption(PRINT, false, "print the token");
    fetcherOptions.addOption(HELP_SHORT, HELP, false, "print out help information");
    GenericOptionsParser parser = new GenericOptionsParser(conf,
        fetcherOptions, args);
    CommandLine cmd = parser.getCommandLine();
   
    // get options
    final String webUrl = cmd.hasOption(WEBSERVICE) ? cmd
        .getOptionValue(WEBSERVICE) : null;
    final String renewer = cmd.hasOption(RENEWER) ?
        cmd.getOptionValue(RENEWER) : null;
    final boolean cancel = cmd.hasOption(CANCEL);
    final boolean renew = cmd.hasOption(RENEW);
    final boolean print = cmd.hasOption(PRINT);
    final boolean help = cmd.hasOption(HELP);
    String[] remaining = parser.getRemainingArgs();

    // check option validity
    if (help) {
      printUsage(System.out);
      System.exit(0);
View Full Code Here

Examples of org.apache.hadoop.util.GenericOptionsParser

  public static JobConf createValueAggregatorJob(String args[])
    throws IOException {

    Configuration conf = new Configuration();
   
    GenericOptionsParser genericParser
      = new GenericOptionsParser(conf, args);
    args = genericParser.getRemainingArgs();
   
    if (args.length < 2) {
      System.out.println("usage: inputDirs outDir "
          + "[numOfReducer [textinputformat|seq [specfile [jobName]]]]");
      GenericOptionsParser.printGenericCommandUsage(System.out);
View Full Code Here

Examples of org.apache.hadoop.util.GenericOptionsParser

    cli.addOption("program", false, "URI to application executable", "class");
    Parser parser = cli.createParser();
    try {

      // check generic arguments -conf
      GenericOptionsParser genericParser = new GenericOptionsParser(getConf(),
          args);
      // get other arguments
      CommandLine results = parser.parse(cli.options,
          genericParser.getRemainingArgs());

      BSPJob job = new BSPJob(getConf());

      if (results.hasOption("input")) {
        FileInputFormat.setInputPaths(job, results.getOptionValue("input"));
View Full Code Here

Examples of org.apache.hadoop.util.GenericOptionsParser

  public static JobConf createValueAggregatorJob(String args[])
    throws IOException {

    Configuration conf = new Configuration();
   
    GenericOptionsParser genericParser
      = new GenericOptionsParser(conf, args);
    args = genericParser.getRemainingArgs();
   
    if (args.length < 2) {
      System.out.println("usage: inputDirs outDir "
          + "[numOfReducer [textinputformat|seq [specfile [jobName]]]]");
      GenericOptionsParser.printGenericCommandUsage(System.out);
View Full Code Here

Examples of org.apache.hadoop.util.GenericOptionsParser

    .create("extrafiles");
   
    opts.addOption(logFiles);
    opts.addOption(extraFiles);
   
    GenericOptionsParser parser =
      new GenericOptionsParser(this.getConf(), opts, args);
   
    String[] remainingArgs = parser.getRemainingArgs();
    if (remainingArgs.length != 1) {
      usage();
      return -1;
    }
    if (remainingArgs[0].compareTo("check") == 0) {
      this.readOnly = true;
    } else if (remainingArgs[0].compareTo("upgrade") != 0) {
      usage();
      return -1;
    }

    if (readOnly) {
      this.logFiles = ACTION.IGNORE;
      this.otherFiles = ACTION.IGNORE;

    } else {
      CommandLine commandLine = parser.getCommandLine();

      ACTION action = null;
      if (commandLine.hasOption("logfiles")) {
        action = options.get(commandLine.getOptionValue("logfiles"));
        if (action == null) {
View Full Code Here

Examples of org.apache.hadoop.util.GenericOptionsParser

  }

  @SuppressWarnings("static-access")
  private int parseArgs(String[] args) {
    Options opts = new Options();
    GenericOptionsParser parser =
      new GenericOptionsParser(this.getConf(), opts, args);
    String[] remainingArgs = parser.getRemainingArgs();
    if (remainingArgs.length != 1) {
      usage();
      return -1;
    }
    if (remainingArgs[0].compareTo("check") == 0) {
View Full Code Here

Examples of org.apache.hadoop.util.GenericOptionsParser

   * @param region HRegion to add to <code>meta</code>
   *
   * @throws IOException
   */
  private int parseArgs(String[] args) {
    GenericOptionsParser parser =
      new GenericOptionsParser(this.getConf(), args);
   
    String[] remainingArgs = parser.getRemainingArgs();
    if (remainingArgs.length != 3) {
      usage();
      return -1;
    }
    tableName = Bytes.toBytes(remainingArgs[0]);
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.