Package org.apache.hadoop.util

Examples of org.apache.hadoop.util.Tool.run()


    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


    waitForHeartBeat(totalUsedSpace, totalCapacity, client, cluster);

    final String[] args = { "-policy", "datanode" };
    final Tool tool = new Cli();   
    tool.setConf(conf);
    final int r = tool.run(args); // start rebalancing
   
    assertEquals("Tools should exit 0 on success", 0, r);
    waitForHeartBeat(totalUsedSpace, totalCapacity, client, cluster);
    LOG.info("Rebalancing with default ctor.");
    waitForBalancer(totalUsedSpace, totalCapacity, client, cluster);
View Full Code Here

  @Test
  public void testIncorrectParameters() throws Exception {
    Tool tool = new InputSampler<Object,Object>(new Configuration());

    int result = tool.run(new String[] { "-r" });
    assertTrue(result != 0);

    result = tool.run(new String[] { "-r", "not-a-number" });
    assertTrue(result != 0);
View Full Code Here

    Tool tool = new InputSampler<Object,Object>(new Configuration());

    int result = tool.run(new String[] { "-r" });
    assertTrue(result != 0);

    result = tool.run(new String[] { "-r", "not-a-number" });
    assertTrue(result != 0);

    // more than one reducer is required:
    result = tool.run(new String[] { "-r", "1" });
    assertTrue(result != 0);
View Full Code Here

    result = tool.run(new String[] { "-r", "not-a-number" });
    assertTrue(result != 0);

    // more than one reducer is required:
    result = tool.run(new String[] { "-r", "1" });
    assertTrue(result != 0);

    try {
      result = tool.run(new String[] { "-inFormat", "java.lang.Object" });
      fail("ClassCastException expected");
View Full Code Here

    // more than one reducer is required:
    result = tool.run(new String[] { "-r", "1" });
    assertTrue(result != 0);

    try {
      result = tool.run(new String[] { "-inFormat", "java.lang.Object" });
      fail("ClassCastException expected");
    } catch (ClassCastException cce) {
      // expected
    }
View Full Code Here

    } catch (ClassCastException cce) {
      // expected
    }

    try {
      result = tool.run(new String[] { "-keyClass", "java.lang.Object" });
      fail("ClassCastException expected");
    } catch (ClassCastException cce) {
      // expected
    }
View Full Code Here

      fail("ClassCastException expected");
    } catch (ClassCastException cce) {
      // expected
    }

    result = tool.run(new String[] { "-splitSample", "1", });
    assertTrue(result != 0);

    result = tool.run(new String[] { "-splitRandom", "1.0", "2", "xxx" });
    assertTrue(result != 0);
View Full Code Here

    }

    result = tool.run(new String[] { "-splitSample", "1", });
    assertTrue(result != 0);

    result = tool.run(new String[] { "-splitRandom", "1.0", "2", "xxx" });
    assertTrue(result != 0);

    result = tool.run(new String[] { "-splitInterval", "yyy", "5" });
    assertTrue(result != 0);
View Full Code Here

    assertTrue(result != 0);

    result = tool.run(new String[] { "-splitRandom", "1.0", "2", "xxx" });
    assertTrue(result != 0);

    result = tool.run(new String[] { "-splitInterval", "yyy", "5" });
    assertTrue(result != 0);

    // not enough subsequent arguments:
    result = tool.run(new String[] { "-r", "2", "-splitInterval", "11.0f", "0", "input" });
    assertTrue(result != 0);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.