Package org.apache.hadoop.util

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


    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);
  }

  @Test
  public void testSplitSample() throws Exception {
View Full Code Here


  }

  @Test
  public void testSplitSample() throws Exception {
    Tool tool = new InputSampler<Object,Object>(new Configuration());
    int result = tool.run(new String[] { "-r", Integer.toString(NUM_REDUCES),
        "-splitSample", "10", "100",
        input1, input2, output });
    assertEquals(0, result);

    Object[] partitions = readPartitions(output);
View Full Code Here

  @Test
  @SuppressWarnings("unchecked")
  public void testSplitRamdom() throws Exception {
    Tool tool = new InputSampler<Object,Object>(new Configuration());
    int result = tool.run(new String[] { "-r", Integer.toString(NUM_REDUCES),
        // Use 0.999 probability to reduce the flakiness of the test because
        // the test will fail if the number of samples is less than (number of reduces + 1).
        "-splitRandom", "0.999f", "20", "100",
        input1, input2, output });
    assertEquals(0, result);
View Full Code Here

  }

  @Test
  public void testSplitInterval() throws Exception {
    Tool tool = new InputSampler<Object,Object>(new Configuration());
    int result = tool.run(new String[] { "-r", Integer.toString(NUM_REDUCES),
        "-splitInterval", "0.5f", "0",
        input1, input2, output });
    assertEquals(0, result);
    Object[] partitions = readPartitions(output);
    assertArrayEquals(new LongWritable[] { new LongWritable(7L), new LongWritable(9L),
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

        if (constArgs == null) {
            throw new RuntimeException("Arguments for distcp constructor is null, unable to instantiate");
        }
        try {
            Tool distcp = (Tool) construct.newInstance(constArgs);
            int i = distcp.run(args);
            if (i != 0) {
                throw new RuntimeException("Returned value from distcp is non-zero (" + i + ")");
            }
        }
        catch (InvocationTargetException ex) {
View Full Code Here

    @Test
    public void runDriver() throws Exception {
        Tool driver = createDriver();
        driver.setConf(conf);

        int result = driver.run(new String[]{input.toString(), output.toString()});
        assertThat(result, is(0));

        verifyOutput();
    }
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

    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

        }
        String[] args = new String[objects.size()];
        for (int i = 0; i < args.length; i++) {
            args[i] = objects.get(i) != null ? objects.get(i).toString() : null;
        }
        run.run(args);
    }

    private Configuration getConfiguration() throws IOException {
        BundleContext bc = FrameworkUtil.getBundle(getClass()).getBundleContext();
        ServiceReference ref = bc.getServiceReference(ConfigurationAdmin.class.getName());
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.