/** * Runs the <code>Tool</code> with its <code>Configuration</code>. * * Equivalent to <code>run(tool.getConf(), tool, args)</code>. * * @param tool <code>Tool</code> to run. * @param args command-line arguments to the tool. * @return exit code of the {@link Tool#run(String[])} method. */ public static int run(Tool tool, String[] args) throws Exception{ return run(tool.getConf(), tool, args); }
public static int runMRJob(Tool tool, String[] args) throws Exception { Configuration conf = tool.getConf(); if (conf == null) { conf = new Configuration(); } GenericOptionsParser parser = getParser(conf, args); //set the configuration back, so that Tool can configure itself tool.setConf(conf); //get the args w/o generic hadoop args String[] toolArgs = parser.getRemainingArgs(); return tool.run(toolArgs); }
void generateAndLoad(final TableName table) throws Exception { LOG.info("Running test testGenerateAndLoad."); String cf = "d"; Path hfiles = new Path( util.getDataTestDirOnTestFS(table.getNameAsString()), "hfiles"); Map<String, String> args = new HashMap<>(); args.put(ImportTsv.BULK_OUTPUT_CONF_KEY, hfiles.toString()); args.put(ImportTsv.COLUMNS_CONF_KEY, format("HBASE_ROW_KEY,HBASE_TS_KEY,%s:c1,%s:c2", cf, cf)); // configure the test harness to NOT delete the HFiles after they're // generated. We need those for doLoadIncrementalHFiles args.put(TestImportTsv.DELETE_AFTER_LOAD_CONF, "false"); // run the job, complete the load. util.createTable(table, new String[]{cf}); Tool t = TestImportTsv.doMROnTableTest(util, table, cf, simple_tsv, args); doLoadIncrementalHFiles(hfiles, table); // validate post-conditions validateDeletedPartitionsFile(t.getConf()); // clean up after ourselves. util.deleteTable(table); util.cleanupDataTestDirOnTestFS(table.getNameAsString()); LOG.info("testGenerateAndLoad completed successfully."); }
/** * Runs the <code>Tool</code> with its <code>Configuration</code>. * * Equivalent to <code>run(tool.getConf(), tool, args)</code>. * * @param tool <code>Tool</code> to run. * @param args command-line arguments to the tool. * @return exit code of the {@link Tool#run(String[])} method. */ public static int run(Tool tool, String[] args) throws Exception{ return run(tool.getConf(), tool, args); }
/** * Runs the <code>Tool</code> with its <code>Configuration</code>. * * Equivalent to <code>run(tool.getConf(), tool, args)</code>. * * @param tool <code>Tool</code> to run. * @param args command-line arguments to the tool. * @return exit code of the {@link Tool#run(String[])} method. */ public static int run(Tool tool, String[] args) throws Exception{ return run(tool.getConf(), tool, args); }
/** * Runs the <code>Tool</code> with its <code>Configuration</code>. * * Equivalent to <code>run(tool.getConf(), tool, args)</code>. * * @param tool <code>Tool</code> to run. * @param args command-line arguments to the tool. * @return exit code of the {@link Tool#run(String[])} method. */ public static int run(Tool tool, String[] args) throws Exception{ return run(tool.getConf(), tool, args); }
@Override public Job getJob(final Tool tool) throws IOException { return new Job(tool.getConf()); }
/** * Runs the <code>Tool</code> with its <code>Configuration</code>. * * Equivalent to <code>run(tool.getConf(), tool, args)</code>. * * @param tool <code>Tool</code> to run. * @param args command-line arguments to the tool. * @return exit code of the {@link Tool#run(String[])} method. */ public static int run(Tool tool, String[] args) throws Exception{ return run(tool.getConf(), tool, args); }
/** * Runs the <code>Tool</code> with its <code>Configuration</code>. * * Equivalent to <code>run(tool.getConf(), tool, args)</code>. * * @param tool <code>Tool</code> to run. * @param args command-line arguments to the tool. * @return exit code of the {@link Tool#run(String[])} method. */ public static int run(Tool tool, String[] args) throws Exception{ return run(tool.getConf(), tool, args); }
/** * Runs the <code>Tool</code> with its <code>Configuration</code>. * * Equivalent to <code>run(tool.getConf(), tool, args)</code>. * * @param tool <code>Tool</code> to run. * @param args command-line arguments to the tool. * @return exit code of the {@link Tool#run(String[])} method. */ public static int run(Tool tool, String[] args) throws Exception{ return run(tool.getConf(), tool, args); }
public static int runMRJob(Tool tool, String[] args) throws Exception { Configuration conf = tool.getConf(); if (conf == null) { conf = new Configuration(); } GenericOptionsParser parser = getParser(conf, args); //set the configuration back, so that Tool can configure itself tool.setConf(conf); //get the args w/o generic hadoop args String[] toolArgs = parser.getRemainingArgs(); return tool.run(toolArgs); }
void generateAndLoad(final TableName table) throws Exception { LOG.info("Running test testGenerateAndLoad."); String cf = "d"; Path hfiles = new Path( util.getDataTestDirOnTestFS(table.getNameAsString()), "hfiles"); Map<String, String> args = new HashMap<>(); args.put(ImportTsv.BULK_OUTPUT_CONF_KEY, hfiles.toString()); args.put(ImportTsv.COLUMNS_CONF_KEY, format("HBASE_ROW_KEY,HBASE_TS_KEY,%s:c1,%s:c2", cf, cf)); // configure the test harness to NOT delete the HFiles after they're // generated. We need those for doLoadIncrementalHFiles args.put(TestImportTsv.DELETE_AFTER_LOAD_CONF, "false"); // run the job, complete the load. util.createTable(table, new String[]{cf}); Tool t = TestImportTsv.doMROnTableTest(util, table, cf, simple_tsv, args); doLoadIncrementalHFiles(hfiles, table); // validate post-conditions validateDeletedPartitionsFile(t.getConf()); // clean up after ourselves. util.deleteTable(table); util.cleanupDataTestDirOnTestFS(table.getNameAsString()); LOG.info("testGenerateAndLoad completed successfully."); }