diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolManager.java index 34629c447e8..8202f730655 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolManager.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolManager.java @@ -150,15 +150,16 @@ class BlockPoolManager { LOG.info("Refresh request received for nameservices: " + conf.get (DFSConfigKeys.DFS_NAMESERVICES)); - final Map> newAddressMap = + Map> newAddressMap = new HashMap<>(); - final Map> newLifelineAddressMap = + Map> newLifelineAddressMap = new HashMap<>(); try { - newAddressMap.putAll(DFSUtil.getNNServiceRpcAddressesForCluster(conf)); - newLifelineAddressMap.putAll( - DFSUtil.getNNLifelineRpcAddressesForCluster(conf)); + newAddressMap = + DFSUtil.getNNServiceRpcAddressesForCluster(conf); + newLifelineAddressMap = + DFSUtil.getNNLifelineRpcAddressesForCluster(conf); } catch (IOException ioe) { LOG.warn("Unable to get NameNode addresses. " + "This may be an Ozone-only cluster.");