aajisaka commented on a change in pull request #3544: URL: https://github.com/apache/hadoop/pull/3544#discussion_r738940853
########## File path: hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNNThroughputBenchmark.java ########## @@ -166,4 +166,31 @@ public void testNNThroughputForAppendOp() throws Exception { } } } + + /** + * This test runs {@link NNThroughputBenchmark} against a mini DFS cluster + * for block report operation. + */ + @Test(timeout = 120000) + public void testNNThroughputForBlockReportOp() throws Exception { + final Configuration conf = new HdfsConfiguration(); + conf.setInt(DFSConfigKeys.DFS_NAMENODE_MIN_BLOCK_SIZE_KEY, 16); + conf.setInt(DFSConfigKeys.DFS_BLOCK_SIZE_KEY, 16); + MiniDFSCluster cluster = null; + try { + cluster = new MiniDFSCluster.Builder(conf).numDataNodes(3).build(); + cluster.waitActive(); + + final Configuration benchConf = new HdfsConfiguration(); + benchConf.setInt(DFSConfigKeys.DFS_NAMENODE_MIN_BLOCK_SIZE_KEY, 16); + benchConf.setInt(DFSConfigKeys.DFS_BLOCK_SIZE_KEY, 16); + NNThroughputBenchmark.runBenchmark(benchConf, + new String[]{"-fs", cluster.getURI().toString(), "-op", + "blockReport", "-datanodes", "3", "-reports", "2"}); + } finally { + if (cluster != null) { + cluster.shutdown(); + } + } Review comment: The update is not correct. The try-with-resources clause will be as follows: ```java try (MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(3).build()) { cluster.waitActive(); final Configuration benchConf = new HdfsConfiguration(); benchConf.setInt(DFSConfigKeys.DFS_NAMENODE_MIN_BLOCK_SIZE_KEY, 16); benchConf.setInt(DFSConfigKeys.DFS_BLOCK_SIZE_KEY, 16); NNThroughputBenchmark.runBenchmark(benchConf, new String[]{"-fs", cluster.getURI().toString(), "-op", "blockReport", "-datanodes", "3", "-reports", "2"}); } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org