Refine search
public static void main(String[] args) throws Exception { int res = ToolRunner.run(new Configuration(), new GenerateData(), args); System.exit(res); }
public static void main(String[] args) throws Exception { int res = ToolRunner.run(new Configuration(), new BuildTestStore(), args); System.exit(res); }
/** * Main program. * * @param args * Command line arguments * @throws Exception */ public static void main(String[] args) throws Exception { int res = ToolRunner.run(new Configuration(), new CredentialShell(), args); System.exit(res); } }
/** * A command line implementation */ public static void main(String[] args) throws Exception { CLI cli = new CLI(new Configuration()); System.exit(ToolRunner.run(cli, args)); }
public static void main(String[] args) throws Exception { System.exit(ToolRunner.run(new Configuration(), new DtUtilShell(), args)); } }
/** * main() entry point for the KeyShell. While strictly speaking the * return is void, it will System.exit() with a return code: 0 is for * success and 1 for failure. * * @param args Command line arguments. * @throws Exception */ public static void main(String[] args) throws Exception { int res = ToolRunner.run(new Configuration(), new KeyShell(), args); System.exit(res); } }
public static void main(String[] args) { try { Configuration conf = new Configuration(); RCFileCat instance = new RCFileCat(); instance.setConf(conf); ToolRunner.run(instance, args); } catch (Exception e) { e.printStackTrace(); System.err.println("\n\n\n"); printUsage(e.getMessage()); System.exit(1); } }
public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); // Parse generic options String[] genericCmdLineOpts = new GenericOptionsParser(conf, args).getCommandLine().getArgs(); Properties jobProperties = CliOptions.parseArgs(CliMRJobLauncher.class, genericCmdLineOpts); // Launch and run the job System.exit(ToolRunner.run(new CliMRJobLauncher(conf, jobProperties), args)); } }
Configuration newConf = new Configuration(); FileSystem fs = archivePath.getFileSystem(newConf); int rc = ToolRunner.run(har, args); if (rc != 0) { throw new Exception("Har returned error code " + rc);
/** * main() has some simple utility methods * @param argv the command and its arguments * @throws Exception upon error */ public static void main(String argv[]) throws Exception { FsShell shell = newShellInstance(); Configuration conf = new Configuration(); conf.setQuietMode(false); shell.setConf(conf); int res; try { res = ToolRunner.run(shell, argv); } finally { shell.close(); } System.exit(res); }
private boolean runCopy(String[] args) throws Exception { int status = ToolRunner.run(new Configuration(TEST_UTIL.getConfiguration()), new CopyTable(), args); return status == 0; }
private boolean runCount(String[] args) throws Exception { // need to make a copy of the configuration because to make sure // different temp dirs are used. int status = ToolRunner.run(new Configuration(UTIL.getConfiguration()), new CellCounter(), args); return status == 0; }
/** * Runs an import job with the specified command line args * @param args * @return true if job completed successfully * @throws IOException * @throws InterruptedException * @throws ClassNotFoundException */ boolean runImport(String[] args) throws Throwable { // need to make a copy of the configuration because to make sure different temp dirs are used. int status = ToolRunner.run(new Configuration(UTIL.getConfiguration()), new Import(), args); return status == 0; }
/** * Runs an export job with the specified command line args * @param args * @return true if job completed successfully * @throws IOException * @throws InterruptedException * @throws ClassNotFoundException */ protected boolean runExport(String[] args) throws Throwable { // need to make a copy of the configuration because to make sure different temp dirs are used. int status = ToolRunner.run(new Configuration(UTIL.getConfiguration()), new Export(), args); return status == 0; }
int valueMultiplier, boolean dataAvailable) throws Exception { String table = args[args.length - 1]; Configuration conf = new Configuration(util.getConfiguration()); Tool tool = new ImportTsv(); LOG.debug("Running ImportTsv with arguments: " + argv); assertEquals(0, ToolRunner.run(conf, tool, argv.toArray(args)));
protected static Tool doMROnTableTest(HBaseTestingUtility util, String family, String data, String[] args, int valueMultiplier) throws Exception { TableName table = TableName.valueOf(args[args.length - 1]); Configuration conf = new Configuration(util.getConfiguration()); try { assertEquals(0, ToolRunner.run(conf, tool, argv.toArray(args))); } finally {
final RegionPredicate bypassregionPredicate, boolean success) throws Exception { URI hdfsUri = FileSystem.get(conf).getUri(); FileSystem fs = FileSystem.get(copyDir.toUri(), new Configuration()); copyDir = copyDir.makeQualified(fs); int res = run(conf, new ExportSnapshot(), opts.toArray(new String[opts.size()])); assertEquals(success ? 0 : 1, res); if (!success) {
/** * Represents the data generation stage. * @throws Exception */ private void teraGenerate() throws Exception { System.out.println("TeraGenerate ==============================================================="); getFileSystem().delete(new Path(generateOutDir), true); final long numLines = dataSizeBytes() / 100; // TeraGen makes 100 bytes ber line if (numLines < 1) throw new IllegalStateException("Data size is too small: " + dataSizeBytes()); // Generate input data: int res = ToolRunner.run(new Configuration(), new TeraGen(), new String[] {"-Dmapreduce.framework.name=local", String.valueOf(numLines), generateOutDir}); assertEquals(0, res); FileStatus[] fileStatuses = getFileSystem().listStatus(new Path(generateOutDir)); long sumLen = 0; for (FileStatus fs: fileStatuses) sumLen += fs.getLen(); assertEquals(dataSizeBytes(), sumLen); // Ensure correct size data is generated. }
@Test public void testWithoutAnExistingTableAndCreateTableSetToNo() throws Exception { String[] args = new String[] { tn.getNameAsString(), "/inputFile" }; Configuration conf = new Configuration(util.getConfiguration()); conf.set(ImportTsv.COLUMNS_CONF_KEY, "HBASE_ROW_KEY,FAM:A"); conf.set(ImportTsv.BULK_OUTPUT_CONF_KEY, "/output"); conf.set(ImportTsv.CREATE_TABLE_CONF_KEY, "no"); exception.expect(TableNotFoundException.class); assertEquals("running test job configuration failed.", 0, ToolRunner.run(new Configuration(util.getConfiguration()), new ImportTsv() { @Override public int run(String[] args) throws Exception { createSubmittableJob(getConf(), args); return 0; } }, args)); }
/** * Implements validation phase of the sample. * @throws Exception */ private void teraValidate() throws Exception { System.out.println("TeraValidate ==============================================================="); getFileSystem().delete(new Path(validateOutDir), true); // Generate input data: int res = ToolRunner.run(new Configuration(), new TeraValidate(), new String[] {"-Dmapreduce.framework.name=local", sortOutDir, validateOutDir}); assertEquals(0, res); FileStatus[] fileStatuses = getFileSystem().listStatus(new Path(validateOutDir), new PathFilter() { @Override public boolean accept(Path path) { // Typically name is "part-r-00000": return path.getName().startsWith("part-r-"); } }); // TeraValidate has only 1 reduce, so should be only 1 result file: assertEquals(1, fileStatuses.length); // The result file must contain only 1 line with the checksum, like this: // "checksum 7a27e2d0d55de", // typically it has length of 23 bytes. // If sorting was not correct, the result contains list of K-V pairs that are not ordered correctly. // In such case the size of the output will be much larger. long len = fileStatuses[0].getLen(); assertTrue("TeraValidate length: " + len, len >= 16 && len <= 32); }