Package org.apache.hadoop.util

Examples of org.apache.hadoop.util.Tool


    }

    // run the import
    List<String> argv = new ArrayList<String>(Arrays.asList(args));
    argv.add(inputPath.toString());
    Tool tool = new ImportTsv();
    LOG.debug("Running ImportTsv with arguments: " + argv);
    assertEquals(0, ToolRunner.run(conf, tool, argv.toArray(args)));

    // Perform basic validation. If the input args did not include
    // ImportTsv.BULK_OUTPUT_CONF_KEY then validate data in the table.
View Full Code Here


            return LAUNCH_ERROR;
        }
        try {
            Configuration conf = options.getConfiguration();
            conf.setClassLoader(options.getApplicationClassLoader());
            Tool tool;
            try {
                tool = ReflectionUtils.newInstance(options.getApplicationClass(), conf);
            } catch (Exception e) {
                LOG.error(MessageFormat.format(
                        "Exception occurred in launcher: {0}{1}",
View Full Code Here

     * @throws Exception if failed to execute command
     */
    public static void main(String... args) throws Exception {
        LOG.info("[OT-CLEAN-I00000] Start Hadoop FS cleaning tool");
        long start = System.currentTimeMillis();
        Tool tool = new Clean();
        tool.setConf(new Configuration());
        int exit = tool.run(args); // no generic options
        long end = System.currentTimeMillis();
        LOG.info(MessageFormat.format(
                "[OT-CLEAN-I00999] Finish Hadoop FS cleaning tool (exit-code={0}, elapsed={1}ms)",
                exit,
                end - start));
View Full Code Here

     * list via program entry.
     * @throws Exception if failed
     */
    @Test
    public void run() throws Exception {
        Tool exec = new DirectIoListTransaction(repo);
        indoubt("ex1");
        indoubt("ex2");
        indoubt("ex3");

        assertThat(ToolRunner.run(conf, exec, new String[0]), is(0));
View Full Code Here

     * Invalid arguments for program entry.
     * @throws Exception if failed
     */
    @Test
    public void run_invalid() throws Exception {
        Tool exec = new DirectIoListTransaction(repo);
        assertThat(ToolRunner.run(conf, exec, new String[] { "1" }), is(not(0)));
    }
View Full Code Here

     * applies via program entry.
     * @throws Exception if failed
     */
    @Test
    public void run() throws Exception {
        Tool exec = new DirectIoApplyTransaction(repo);

        indoubt("ex1");
        assertThat(count(production1), is(0));
        assertThat(count(production2), is(0));

View Full Code Here

     * applies via program entry but failed.
     * @throws Exception if failed
     */
    @Test
    public void run_failure() throws Exception {
        Tool exec = new DirectIoApplyTransaction(repo);
        indoubt("ex1");

        writable(production1, false);
        assertThat(ToolRunner.run(conf, exec, new String[] {"ex1"}), is(not(0)));
    }
View Full Code Here

     * Invalid arguments for program entry.
     * @throws Exception if failed
     */
    @Test
    public void run_invalid() throws Exception {
        Tool exec = new DirectIoApplyTransaction(repo);
        assertThat(ToolRunner.run(conf, exec, new String[] { }), is(not(0)));
        assertThat(ToolRunner.run(conf, exec, new String[] {"1", "2"}), is(not(0)));
    }
View Full Code Here

     * aborts via program entry.
     * @throws Exception if failed
     */
    @Test
    public void run() throws Exception {
        Tool exec = new DirectIoAbortTransaction(repo);

        indoubt("ex1");
        assertThat(count(production1), is(0));
        assertThat(count(production2), is(0));

View Full Code Here

     * Invalid arguments for program entry.
     * @throws Exception if failed
     */
    @Test
    public void run_invalid() throws Exception {
        Tool exec = new DirectIoAbortTransaction(repo);
        assertThat(ToolRunner.run(conf, exec, new String[] { }), is(not(0)));
        assertThat(ToolRunner.run(conf, exec, new String[] {"1", "2"}), is(not(0)));
    }
View Full Code Here

TOP

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

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.