Package org.apache.hadoop.util

Examples of org.apache.hadoop.util.GenericOptionsParser


          }
        }
        list.add(sb.toString());
      }

      new GenericOptionsParser(cfg, list.toArray(new String[list.size()]));
    } catch (IOException ex) {
      throw new IllegalStateException(ex);
    }
  }
View Full Code Here


    HBaseTestingUtility htu1 = new HBaseTestingUtility();

    htu1.startMiniCluster();
    htu1.startMiniMapReduceCluster();

    GenericOptionsParser opts = new GenericOptionsParser(htu1.getConfiguration(), args);
    Configuration conf = opts.getConfiguration();
    args = opts.getRemainingArgs();

    try {

      FileSystem fs = FileSystem.get(conf);
      FSDataOutputStream op = fs.create(new Path(inputFile), true);
View Full Code Here

 
  //private static Logger log = Logger.getLogger(XadoopDriver.class);
 
  public static void main(String[] args) throws IOException {
    Configuration configuration = new Configuration();
    GenericOptionsParser parser = new GenericOptionsParser(configuration, args);
    args = parser.getRemainingArgs();

    if (args.length < 2) {
      System.err.println("Usage: <input dir> <output dir>");
      System.exit(2);
    }
View Full Code Here

 
  //private static Logger log = Logger.getLogger(XadoopDriver.class);
 
  public static void main(String[] args) throws IOException {
    Configuration configuration = new Configuration();
    GenericOptionsParser parser = new GenericOptionsParser(configuration, args);
    args = parser.getRemainingArgs();

    if (args.length < 2) {
      System.err.println("Usage: <input dir> <output dir>");
      //log.error("Usage: <input dir> <output dir>");
      System.exit(2);
View Full Code Here

    return result;
  }

  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

   * @param args  The command line parameters.
   * @throws Exception When running the job fails.
   */
  public static void main(String[] args) throws Exception {
    HBaseConfiguration conf = new HBaseConfiguration();
    String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
    if (otherArgs.length < 3) {
      System.err.println("ERROR: Wrong number of parameters: " + args.length);
      System.err.println("Usage: " + NAME +
        " <outputdir> <tablename> <column1> [<column2>...]");
      System.exit(-1);
View Full Code Here

   *
   * @param group job-specific command-line options.
   */
  public static void printHelpWithGenericOptions(Group group) {
    org.apache.commons.cli.Options ops = new org.apache.commons.cli.Options();
    new GenericOptionsParser(new Configuration(), ops, new String[0]);
    org.apache.commons.cli.HelpFormatter fmt = new org.apache.commons.cli.HelpFormatter();
    fmt.printHelp("<command> [Generic Options] [Job-Specific Options]",
        "Generic Options:", ops, "");
   
    PrintWriter pw = new PrintWriter(System.out);
View Full Code Here

    pw.flush();
  }

  public static void printHelpWithGenericOptions(Group group, OptionException oe) {
    org.apache.commons.cli.Options ops = new org.apache.commons.cli.Options();
    new GenericOptionsParser(new Configuration(), ops, new String[0]);
    org.apache.commons.cli.HelpFormatter fmt = new org.apache.commons.cli.HelpFormatter();
    fmt.printHelp("<command> [Generic Options] [Job-Specific Options]",
        "Generic Options:", ops, "");

    PrintWriter pw = new PrintWriter(System.out);
View Full Code Here

  }

  @Override
  public int run(String[] args) throws Exception {
    setConf(HBaseConfiguration.create(getConf()));
    String[] otherArgs = new GenericOptionsParser(getConf(), args).getRemainingArgs();
    if (otherArgs.length < 2) {
      usage("Wrong number of arguments: " + otherArgs.length);
      return -1;
    }
View Full Code Here

   * @param args  The command line parameters.
   * @throws Exception When running the job fails.
   */
  public static void main(String[] args) throws Exception {
    HBaseConfiguration conf = new HBaseConfiguration();
    String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
    if (otherArgs.length < 2) {
      usage("Wrong number of arguments: " + otherArgs.length);
      System.exit(-1);
    }
    Job job = createSubmittableJob(conf, otherArgs);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.util.GenericOptionsParser

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.