Refine search
public AppConfig loadConfig(String[] args) { AppConfig cf = new AppConfig(); try { GenericOptionsParser parser = new GenericOptionsParser(cf, args); if (parser.getRemainingArgs().length > 0) usage(); } catch (IOException e) { LOG.error("Unable to parse options: " + e); usage(); } return cf; }
String numMaps = new GenericOptionsParser(conf, args).getRemainingArgs()[0]; conf.set(MRJobConfig.NUM_MAPS, numMaps); createHdfsFilesystem(conf);
@Override public int run(String[] args) throws Exception { String[] otherArgs = new GenericOptionsParser(getConf(), args).getRemainingArgs(); if (!doCommandLine(otherArgs)) { return 1; } Job job = createSubmittableJob(otherArgs); if (!job.waitForCompletion(true)) { LOG.info("Map-reduce job failed!"); return 1; } counters = job.getCounters(); return 0; }
@Override public int run(String[] args) throws Exception { String[] otherArgs = new GenericOptionsParser(getConf(), args).getRemainingArgs(); if (!doCommandLine(otherArgs)) { return 1; } Job job = createSubmittableJob(otherArgs); writeTempManifestFile(); if (!job.waitForCompletion(true)) { LOG.info("Map-reduce job failed!"); return 1; } completeManifest(); return 0; }
private void readArgs(String[] args) throws Exception { args = new GenericOptionsParser(getConf(), args).getRemainingArgs();
@SuppressWarnings("static-access") public static void main(String[] args) throws IOException { GenericOptionsParser genericParser = new GenericOptionsParser(args); String[] remainingArgs = genericParser.getRemainingArgs();
conf = new Configuration(); GenericOptionsParser parser = new GenericOptionsParser(conf, args); String[] toolArgs = parser.getRemainingArgs(); return tool.run(toolArgs);
@VisibleForTesting static Map<byte[], Response> run(final Configuration conf, final String[] args) throws Throwable { String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs(); if (!ExportUtils.isValidArguements(args)) { ExportUtils.usage("Wrong number of arguments: " + ArrayUtils.getLength(otherArgs)); return null; } Triple<TableName, Scan, Path> arguments = ExportUtils.getArgumentsFromCommandLine(conf, otherArgs); return run(conf, arguments.getFirst(), arguments.getSecond(), arguments.getThird()); }
public static void main(String... argv) throws Exception { Configuration hadoopConfig = HBaseConfiguration.create(); String[] otherArgs = new GenericOptionsParser(hadoopConfig, argv).getRemainingArgs(); main(hadoopConfig, otherArgs); }
public static void main(String... argv) throws Exception { Configuration hadoopConfig = HBaseConfiguration.create(); String[] otherArgs = new GenericOptionsParser(hadoopConfig, argv).getRemainingArgs(); main(hadoopConfig, otherArgs); }
Configuration conf = new Configuration(UTIL.getConfiguration()); String[] otherArgs = new GenericOptionsParser(conf, argsWithLabels).getRemainingArgs(); Scan scanWithLabels = ExportUtils.getScanFromCommandLine(conf, otherArgs); assertEquals(version, scanWithLabels.getMaxVersions());
/** * Main entry point. * * @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(); CommandLine cmd = parseArgs(otherArgs); // check debug flag and other options if (cmd.hasOption("d")) conf.set("conf.debug", "true"); // get details String table = cmd.getOptionValue("t"); String input = cmd.getOptionValue("i"); // create job and set classes etc. Job job = Job.getInstance(conf, "Import from file " + input + " into table " + table); job.setJarByClass(ImportJsonFromFile.class); job.setMapperClass(ImportMapper.class); job.setOutputFormatClass(TableOutputFormat.class); job.getConfiguration().set(TableOutputFormat.OUTPUT_TABLE, table); job.setOutputKeyClass(ImmutableBytesWritable.class); job.setOutputValueClass(Writable.class); job.setNumReduceTasks(0); FileInputFormat.addInputPath(job, new Path(input)); // run the job System.exit(job.waitForCompletion(true) ? 0 : 1); } }
String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs(); if (otherArgs.length != 2) { theLogger.warn("Usage: SortInMemoryProjectionDriver <input> <output>");
public static void main(String... argv) throws IOException { String[] otherArgs = new GenericOptionsParser(argv).getRemainingArgs(); CommandLine cli = GeoEnrichmentOptions.parse(new PosixParser(), otherArgs); MaxmindDbEnrichmentLoader loader = new MaxmindDbEnrichmentLoader(); loader.loadGeoLiteDatabase(cli); } }
public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs(); if (otherArgs.length != 3) { System.err.println("Usage: SortInMemory_MovingAverageDriver <window_size> <input> <output>");
Configuration conf = HBaseConfiguration.create(); String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs(); // co ImportFromFile-7-Args Give the command line arguments to the generic parser first to handle "-Dxyz" properties. CommandLine cmd = parseArgs(otherArgs);
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: MeanDriver <input> <output>");
Configuration conf = HBaseConfiguration.create(); String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs(); CommandLine cmd = parseArgs(otherArgs);
public static void main(String... argv) throws IOException, java.text.ParseException, ClassNotFoundException, InterruptedException { Configuration conf = HBaseConfiguration.create(); String[] otherArgs = new GenericOptionsParser(conf, argv).getRemainingArgs(); CommandLine cli = BulkLoadOptions.parse(new PosixParser(), otherArgs); Long ts = BulkLoadOptions.getTimestamp(cli); String table = BulkLoadOptions.TABLE.get(cli); String cf = BulkLoadOptions.COLUMN_FAMILY.get(cli); String accessTrackerTable = BulkLoadOptions.ACCESS_TABLE.get(cli); String accessTrackerCF = BulkLoadOptions.ACCESS_COLUMN_FAMILY.get(cli); Job job = createJob(conf, table, cf, accessTrackerTable, accessTrackerCF, ts); System.exit(job.waitForCompletion(true) ? 0 : 1); } }
String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs(); if (otherArgs.length != 2) { System.err.println("Usage: SecondarySortDriver <input> <output>");