Skip to content

Commit 81910d1

Browse files
author
zengqiao
committed
[Hotfix] 修复新接入集群时,健康状态信息页面出现空指针问题
1 parent 55d5fc4 commit 81910d1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

km-biz/src/main/java/com/xiaojukeji/know/streaming/km/biz/cluster/impl/MultiClusterPhyManagerImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,16 @@ public ClusterPhysHealthState getClusterPhysHealthState() {
8484
ClusterPhysHealthState physState = new ClusterPhysHealthState(clusterPhyList.size());
8585
for (ClusterPhy clusterPhy: clusterPhyList) {
8686
ClusterMetrics metrics = clusterMetricService.getLatestMetricsFromCache(clusterPhy.getId());
87-
Integer state = metrics.getMetric(ClusterMetricVersionItems.CLUSTER_METRIC_HEALTH_STATE).intValue();
87+
Float state = metrics.getMetric(ClusterMetricVersionItems.CLUSTER_METRIC_HEALTH_STATE);
8888
if (state == null) {
8989
physState.setUnknownCount(physState.getUnknownCount() + 1);
90-
} else if (state.equals(HealthStateEnum.GOOD.getDimension())) {
90+
} else if (state.intValue() == HealthStateEnum.GOOD.getDimension()) {
9191
physState.setGoodCount(physState.getGoodCount() + 1);
92-
} else if (state.equals(HealthStateEnum.MEDIUM.getDimension())) {
92+
} else if (state.intValue() == HealthStateEnum.MEDIUM.getDimension()) {
9393
physState.setMediumCount(physState.getMediumCount() + 1);
94-
} else if (state.equals(HealthStateEnum.POOR.getDimension())) {
94+
} else if (state.intValue() == HealthStateEnum.POOR.getDimension()) {
9595
physState.setPoorCount(physState.getPoorCount() + 1);
96-
} else if (state.equals(HealthStateEnum.DEAD.getDimension())) {
96+
} else if (state.intValue() == HealthStateEnum.DEAD.getDimension()) {
9797
physState.setDeadCount(physState.getDeadCount() + 1);
9898
} else {
9999
physState.setUnknownCount(physState.getUnknownCount() + 1);

0 commit comments

Comments
 (0)