From 8627f6532baa0488c28514d9dfdd5c4f8bf8f378 Mon Sep 17 00:00:00 2001 From: Akira Ajisaka Date: Fri, 7 Jun 2019 15:43:38 +0900 Subject: [PATCH] HDFS-14550. RBF: Failed to get statistics from NameNodes before 2.9.0. Contributed by He Xiaoqiao. --- .../server/federation/router/NamenodeHeartbeatService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/NamenodeHeartbeatService.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/NamenodeHeartbeatService.java index d50a5fcdf4..bb601c5889 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/NamenodeHeartbeatService.java +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/NamenodeHeartbeatService.java @@ -353,9 +353,9 @@ private void updateJMXParameters( jsonObject.getInt("NumDecommissioningDataNodes"), jsonObject.getInt("NumDecomLiveDataNodes"), jsonObject.getInt("NumDecomDeadDataNodes"), - jsonObject.getInt("NumInMaintenanceLiveDataNodes"), - jsonObject.getInt("NumInMaintenanceDeadDataNodes"), - jsonObject.getInt("NumEnteringMaintenanceDataNodes")); + jsonObject.optInt("NumInMaintenanceLiveDataNodes"), + jsonObject.optInt("NumInMaintenanceDeadDataNodes"), + jsonObject.optInt("NumEnteringMaintenanceDataNodes")); } else if (name.equals( "Hadoop:service=NameNode,name=FSNamesystem")) { report.setNamesystemInfo(