Package org.apache.hadoop.util

Examples of org.apache.hadoop.util.GenericOptionsParser


  }

  @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


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

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

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

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

      b.append(s);
      join = ",";
    }

   
    new GenericOptionsParser(conf, new String[]{"-libjars",b.toString()});
    System.out.println("tmpjars:"+b.toString()+"@@@@@"+conf.get("tmpjars"));


  }
View Full Code Here

    private LauncherOptions analyze() throws IOException, InterruptedException {
        LinkedList<String> copy = new LinkedList<String>(arguments);
        String applicationClassName = consumeApplicationClassName(copy);
        List<Path> libraryPaths = consumeLibraryPaths(copy);
        GenericOptionsParser genericOptions = processGenericOptions(copy);
        URLClassLoader applicationClassLoader = buildApplicationClassLoader(libraryPaths, applicationClassName);
        Class<? extends Tool> applicationClass = buildApplicationClass(applicationClassName);

        return new LauncherOptions(
                configuration,
                applicationClass,
                Arrays.asList(genericOptions.getRemainingArgs()),
                applicationClassLoader,
                applicationCacheFiles);
    }
View Full Code Here

        return results;
    }

    private GenericOptionsParser processGenericOptions(LinkedList<String> rest) throws IOException {
        String[] args = rest.toArray(new String[rest.size()]);
        return new GenericOptionsParser(configuration, args);
    }
View Full Code Here

    }
  }

  public static void main(String[] args) throws Exception {
    Configuration conf = new Configuration();
    String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
    if (otherArgs.length < 2) {
      System.err.println("Usage: wordcount <in> [<in>...] <out>");
      System.exit(2);
    }
    Job job = new Job(conf, "word count");
View Full Code Here

    System.exit(ret);
  }

  @Override
  public int run(String[] args) throws Exception {
    String[] otherArgs = new GenericOptionsParser(getConf(), args).getRemainingArgs();
    Job job = createSubmittableJob(getConf(), otherArgs);
    if (job == null) return 1;
    return job.waitForCompletion(true) ? 0 : 1;
  }
View Full Code Here

    return options;
  }

  private static CommandLine parseArguments(Configuration conf, Options options, String[] args)
      throws ParseException, IOException {
    GenericOptionsParser genParser = new GenericOptionsParser(conf, args);
    String[] remainingArgs = genParser.getRemainingArgs();
    CommandLineParser parser = new PosixParser();
    return parser.parse(options, remainingArgs);
  }
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 {
    Configuration conf = HBaseConfiguration.create();
    String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
    if (otherArgs.length < 2) {
      usage("Wrong number of arguments: " + otherArgs.length);
      System.exit(-1);
    }

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.