コード例 #1
0
 public static void testWrite() throws Exception {
   FileSystem fs = cluster.getFileSystem();
   long tStart = System.currentTimeMillis();
   bench.writeTest(fs);
   long execTime = System.currentTimeMillis() - tStart;
   bench.analyzeResult(fs, TestType.TEST_TYPE_WRITE, execTime);
 }
コード例 #2
0
 @Test(timeout = 6000)
 public void testAppend() throws Exception {
   FileSystem fs = cluster.getFileSystem();
   long tStart = System.currentTimeMillis();
   bench.appendTest(fs);
   long execTime = System.currentTimeMillis() - tStart;
   bench.analyzeResult(fs, TestType.TEST_TYPE_APPEND, execTime);
 }
コード例 #3
0
 @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);
 }
コード例 #4
0
 @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);
 }
コード例 #5
0
  @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();
  }
コード例 #6
0
 @AfterClass
 public static void afterClass() throws Exception {
   if (cluster == null) return;
   FileSystem fs = cluster.getFileSystem();
   bench.cleanup(fs);
   cluster.shutdown();
 }