secfree commented on a change in pull request #3847:
URL: https://github.com/apache/hadoop/pull/3847#discussion_r794380185
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeMetrics.java
##########
@@ -654,4 +658,38 @@ public void testNNRpcMetricsWithFederationAndHA() throws
IOException {
assertCounter("HeartbeatsForns1-nn1NumOps", 1L, rb);
assertCounter("HeartbeatsNumOps", 4L, rb);
}
+
+ @Test
+ public void testNodeLocalMetrics() throws Exception {
+ Assume.assumeTrue(null == DomainSocket.getLoadingFailureReason());
+ Configuration conf = new HdfsConfiguration();
+ conf.setBoolean(HdfsClientConfigKeys.Read.ShortCircuit.KEY, true);
+ TemporarySocketDirectory sockDir = new TemporarySocketDirectory();
+ DomainSocket.disableBindPathValidation();
+ conf.set(DFSConfigKeys.DFS_DOMAIN_SOCKET_PATH_KEY,
+ new File(sockDir.getDir(),
+ "testNodeLocalMetrics._PORT.sock").getAbsolutePath());
+ MiniDFSCluster cluster = new
MiniDFSCluster.Builder(conf).numDataNodes(1).build();
+ try {
+ cluster.waitActive();
+ FileSystem fs = cluster.getFileSystem();
+ Path testFile = new Path("/testNodeLocalMetrics.txt");
+ DFSTestUtil.createFile(fs, testFile, 10L, (short)1, 1L);
+ DFSTestUtil.readFile(fs, testFile);
+ List<DataNode> datanodes = cluster.getDataNodes();
+ assertEquals(datanodes.size(), 1);
Review comment:
Thanks for your review. I've fixed it.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]