[ 
https://issues.apache.org/jira/browse/HDFS-16528?focusedWorklogId=758912&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-758912
 ]

ASF GitHub Bot logged work on HDFS-16528:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/Apr/22 01:30
            Start Date: 20/Apr/22 01:30
    Worklog Time Spent: 10m 
      Work Description: tomscut commented on code in PR #4186:
URL: https://github.com/apache/hadoop/pull/4186#discussion_r853653286


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java:
##########
@@ -2406,27 +2412,49 @@ String reconfigureSlowNodesParameters(final 
DatanodeManager datanodeManager,
     namesystem.writeLock();
     String result;
     try {
-      if (property.equals(DFS_NAMENODE_AVOID_SLOW_DATANODE_FOR_READ_KEY)) {
-        boolean enable = (newVal == null ? 
DFS_NAMENODE_AVOID_SLOW_DATANODE_FOR_READ_DEFAULT :
+      switch (property) {
+      case DFS_NAMENODE_AVOID_SLOW_DATANODE_FOR_READ_KEY: {
+        boolean enable = (newVal == null ?
+            DFS_NAMENODE_AVOID_SLOW_DATANODE_FOR_READ_DEFAULT :
             Boolean.parseBoolean(newVal));
         result = Boolean.toString(enable);
         datanodeManager.setAvoidSlowDataNodesForReadEnabled(enable);
-      } else if (property.equals(
-            DFS_NAMENODE_BLOCKPLACEMENTPOLICY_EXCLUDE_SLOW_NODES_ENABLED_KEY)) 
{
+        break;
+      }
+      case DFS_NAMENODE_BLOCKPLACEMENTPOLICY_EXCLUDE_SLOW_NODES_ENABLED_KEY: {
         boolean enable = (newVal == null ?
             
DFS_NAMENODE_BLOCKPLACEMENTPOLICY_EXCLUDE_SLOW_NODES_ENABLED_DEFAULT :
             Boolean.parseBoolean(newVal));
         result = Boolean.toString(enable);
         bm.setExcludeSlowNodesEnabled(enable);
-      } else if (property.equals(DFS_NAMENODE_MAX_SLOWPEER_COLLECT_NODES_KEY)) 
{
+        break;
+      }
+      case DFS_NAMENODE_MAX_SLOWPEER_COLLECT_NODES_KEY: {
         int maxSlowpeerCollectNodes = (newVal == null ?
             DFS_NAMENODE_MAX_SLOWPEER_COLLECT_NODES_DEFAULT :
             Integer.parseInt(newVal));
         result = Integer.toString(maxSlowpeerCollectNodes);
         datanodeManager.setMaxSlowpeerCollectNodes(maxSlowpeerCollectNodes);
-      } else {
-        throw new IllegalArgumentException("Unexpected property " +
-            property + " in reconfigureSlowNodesParameters");
+        break;
+      }
+      case DFS_DATANODE_PEER_STATS_ENABLED_KEY: {
+        Timer timer = new Timer();
+        if (newVal != null && !newVal.equalsIgnoreCase("true") && 
!newVal.equalsIgnoreCase(
+            "false")) {
+          throw new ReconfigurationException(property, newVal, 
getConf().get(property),
+              new NumberFormatException(newVal + " is not boolean value"));

Review Comment:
   Hi @virajjasani , should here throw an IllegalArgumentException?





Issue Time Tracking
-------------------

    Worklog Id:     (was: 758912)
    Time Spent: 1h  (was: 50m)

> Reconfigure slow peer enable for Namenode
> -----------------------------------------
>
>                 Key: HDFS-16528
>                 URL: https://issues.apache.org/jira/browse/HDFS-16528
>             Project: Hadoop HDFS
>          Issue Type: Task
>            Reporter: Viraj Jasani
>            Assignee: Viraj Jasani
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> HDFS-16396 provides reconfig options for several configs associated with 
> slownodes in Datanode. Similarly, HDFS-16287 and HDFS-16327 have added some 
> slownodes related configs as the reconfig options in Namenode.
> The purpose of this Jira is to add DFS_DATANODE_PEER_STATS_ENABLED_KEY as 
> reconfigurable option for Namenode (similar to how HDFS-16396 has included it 
> for Datanode).



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to