sunchao commented on a change in pull request #2080:
URL: https://github.com/apache/hadoop/pull/2080#discussion_r449907165
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterRpc.java
##########
@@ -1777,6 +1777,43 @@ public void testgetGroupsForUser() throws IOException {
assertArrayEquals(group, result);
}
+ @Test
+ public void testGetCachedDatanodeReport() throws Exception {
+ final DatanodeInfo[] datanodeReport =
+ routerProtocol.getDatanodeReport(DatanodeReportType.ALL);
+
+ // We should have 12 nodes in total
+ assertEquals(12, datanodeReport.length);
+
+ // We should be caching this information
+ DatanodeInfo[] datanodeReport1 =
+ routerProtocol.getDatanodeReport(DatanodeReportType.ALL);
+ assertArrayEquals(datanodeReport1, datanodeReport);
+
+ // Add one datanode
+
getCluster().getCluster().startDataNodes(getCluster().getCluster().getConfiguration(0),
Review comment:
I think we need to clear state after the test case so that it won't
affect others like `testNamenodeMetrics`.
Also long line.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]