@BeforeClass public static void beforeClass() throws Exception { bench = new TestDFSIO(); bench.getConf().setBoolean(DFSConfigKeys.DFS_SUPPORT_APPEND_KEY, true); cluster = new MiniDFSCluster.Builder(bench.getConf()).numDataNodes(2).format(true).build(); FileSystem fs = cluster.getFileSystem(); bench.createControlFile(fs, DEFAULT_NR_BYTES, DEFAULT_NR_FILES); /** Check write here, as it is required for other tests */ testWrite(); }
@Test(timeout = 3000) public void testReadSkip() throws Exception { FileSystem fs = cluster.getFileSystem(); long tStart = System.currentTimeMillis(); bench.getConf().setLong("test.io.skip.size", 1); bench.randomReadTest(fs); long execTime = System.currentTimeMillis() - tStart; bench.analyzeResult(fs, TestType.TEST_TYPE_READ_SKIP, execTime); }
@Test(timeout = 3000) public void testReadBackward() throws Exception { FileSystem fs = cluster.getFileSystem(); long tStart = System.currentTimeMillis(); bench.getConf().setLong("test.io.skip.size", -DEFAULT_BUFFER_SIZE); bench.randomReadTest(fs); long execTime = System.currentTimeMillis() - tStart; bench.analyzeResult(fs, TestType.TEST_TYPE_READ_BACKWARD, execTime); }