Example usage for org.apache.hadoop.fs TestDFSIO setConf

List of usage examples for org.apache.hadoop.fs TestDFSIO setConf

Introduction

In this page you can find the example usage for org.apache.hadoop.fs TestDFSIO setConf.

Prototype

@Override 
    public void setConf(Configuration conf) 

Source Link

Usage

From source file:org.apache.whirr.service.hadoop.integration.benchmark.HadoopServiceTestDFSIOBenchmark.java

License:Apache License

@Test
public void test() throws Exception {
    // We use TestDFSIO's Tool interface so we can pass the configuration,
    // but this is only available after Hadoop 0.20.2
    // (https://issues.apache.org/jira/browse/MAPREDUCE-1832)
    // so we use a local copy of TestDFSIO with this patch
    int runs = Integer.parseInt(System.getProperty("testDFSIORuns", "3"));
    for (int i = 0; i < runs; i++) {
        LOG.info("Starting TestDFSIO run {} of {}", i + 1, runs);
        TestDFSIO testDFSIO = new TestDFSIO();
        JobConf jobConf = controller.getJobConf();
        jobConf.set("test.build.data", "/user/root/benchmark/TestDFSIO");
        testDFSIO.setConf(jobConf);
        testDFSIO.run("-write -nrFiles 10 -fileSize 1000".split(" "));
        testDFSIO.run("-read -nrFiles 10 -fileSize 1000".split(" "));
        testDFSIO.run(new String[] { "-clean" });
        LOG.info("Completed TestDFSIO run {} of {}", i + 1, runs);
    }//from w w  w. j  a va  2s  . c  om
}