From 7ff326129dc3413e5e978feadd66e4eae3506e8d Mon Sep 17 00:00:00 2001 From: Daniel-009497 <18710890153@163.com> Date: Wed, 21 Dec 2022 07:12:02 +0800 Subject: [PATCH] HDFS-16871 DiskBalancer process may throw IllegalArgumentException when the target DataNode has capital letter in hostname (#5240) --- .../hdfs/server/diskbalancer/datamodel/DiskBalancerCluster.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/datamodel/DiskBalancerCluster.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/datamodel/DiskBalancerCluster.java index c801f36ea52..7e935a3f820 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/datamodel/DiskBalancerCluster.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/datamodel/DiskBalancerCluster.java @@ -389,6 +389,6 @@ public class DiskBalancerCluster { * @return DiskBalancerDataNode. */ public DiskBalancerDataNode getNodeByName(String hostName) { - return hostNames.get(hostName); + return hostNames.get(hostName.toLowerCase(Locale.US)); } }