haiyang1987 commented on code in PR #6112:
URL: https://github.com/apache/hadoop/pull/6112#discussion_r1337956846
##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNameNodeReconfigure.java:
##########
@@ -654,6 +655,52 @@ public void
testReconfigureDecommissionBackoffMonitorParameters()
}
}
+ @Test
+ public void testReconfigureMinBlocksForWrite() throws Exception {
+ final NameNode nameNode = cluster.getNameNode(0);
+ final BlockManager bm = nameNode.getNamesystem().getBlockManager();
+ String key =
DFSConfigKeys.DFS_NAMENODE_BLOCKPLACEMENTPOLICY_MIN_BLOCKS_FOR_WRITE_KEY;
+ int defaultVal =
DFSConfigKeys.DFS_NAMENODE_BLOCKPLACEMENTPOLICY_MIN_BLOCKS_FOR_WRITE_DEFAULT;
+
+ // Ensure we cannot set any of the parameters negative
+ ReconfigurationException reconfigurationException =
+ LambdaTestUtils.intercept(ReconfigurationException.class,
+ () -> nameNode.reconfigurePropertyImpl(key, "-20"));
+ assertTrue(reconfigurationException.getCause() instanceof
IllegalArgumentException);
+ assertEquals(key+" = '-20' is invalid. It should be a "
Review Comment:
Thanks Sir @Hexiaoqiao review and suggestion.
Update PR, please help me review it agagin when you have free time. Thanks
a lot~
--
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]