ayushtkn commented on code in PR #6112:
URL: https://github.com/apache/hadoop/pull/6112#discussion_r1339106383
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/HdfsServerConstants.java:
##########
@@ -42,6 +42,7 @@
@InterfaceAudience.Private
public interface HdfsServerConstants {
+ // Will set by {@code
DFSConfigKeys.DFS_NAMENODE_BLOCKPLACEMENTPOLICY_MIN_BLOCKS_FOR_WRITE_KEY}.
Review Comment:
nit
`` Will be set by```
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java:
##########
@@ -2671,6 +2676,18 @@ private String
reconfigureDecommissionBackoffMonitorParameters(
}
}
+ private String reconfigureMinBlocksForWrite(String property, String newValue)
+ throws ReconfigurationException {
+ try {
+ int newSetting = adjustNewVal(
+ DFS_NAMENODE_BLOCKPLACEMENTPOLICY_MIN_BLOCKS_FOR_WRITE_DEFAULT,
newValue);
+ this.namesystem.getBlockManager().setMinBlocksForWrite(newSetting);
Review Comment:
``this.namesystem`` isn't required, can be just
``namesystem.getBlockManager()``?
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java:
##########
@@ -5683,4 +5683,16 @@ public void setExcludeSlowNodesEnabled(boolean enable) {
public boolean getExcludeSlowNodesEnabled(BlockType blockType) {
return placementPolicies.getPolicy(blockType).getExcludeSlowNodesEnabled();
}
+
+ public void setMinBlocksForWrite(int minBlocksForWrite) {
+ ensurePositiveInt(minBlocksForWrite,
+
DFSConfigKeys.DFS_NAMENODE_BLOCKPLACEMENTPOLICY_MIN_BLOCKS_FOR_WRITE_KEY);
Review Comment:
nit
``` DFSConfigKeys.``` isn't required actually there is a static import on
top
```
L20: import static org.apache.hadoop.hdfs.DFSConfigKeys.*;
```
--
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]