[
https://issues.apache.org/jira/browse/HDFS-16528?focusedWorklogId=758964&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-758964
]
ASF GitHub Bot logged work on HDFS-16528:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 20/Apr/22 05:18
Start Date: 20/Apr/22 05:18
Worklog Time Spent: 10m
Work Description: virajjasani commented on code in PR #4186:
URL: https://github.com/apache/hadoop/pull/4186#discussion_r853733962
##########
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:
Sounds good, let me change this. Thanks @tomscut
Issue Time Tracking
-------------------
Worklog Id: (was: 758964)
Time Spent: 1.5h (was: 1h 20m)
> 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: 1.5h
> 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]