You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by lx...@apache.org on 2016/09/29 01:38:14 UTC

[4/4] helix git commit: Fix NPE when first time call WorkflowRebalancer

Fix NPE when first time call WorkflowRebalancer


Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/dca1ed05
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/dca1ed05
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/dca1ed05

Branch: refs/heads/helix-0.6.x
Commit: dca1ed05bfccce69814fdb59b095d734d1c82de0
Parents: f5705dc
Author: Junkai Xue <jx...@linkedin.com>
Authored: Thu Sep 22 16:37:12 2016 -0700
Committer: Junkai Xue <jx...@linkedin.com>
Committed: Thu Sep 22 16:37:12 2016 -0700

----------------------------------------------------------------------
 .../apache/helix/monitoring/mbeans/ClusterStatusMonitor.java    | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/dca1ed05/helix-core/src/main/java/org/apache/helix/monitoring/mbeans/ClusterStatusMonitor.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/monitoring/mbeans/ClusterStatusMonitor.java b/helix-core/src/main/java/org/apache/helix/monitoring/mbeans/ClusterStatusMonitor.java
index 9b13e76..7f996c5 100644
--- a/helix-core/src/main/java/org/apache/helix/monitoring/mbeans/ClusterStatusMonitor.java
+++ b/helix-core/src/main/java/org/apache/helix/monitoring/mbeans/ClusterStatusMonitor.java
@@ -463,6 +463,11 @@ public class ClusterStatusMonitor implements ClusterStatusMonitorMBean {
   }
 
   private void updateJobGauges(JobConfig jobConfig, TaskState current) {
+    // When first time for WorkflowRebalancer call, jobconfig may not ready.
+    // Thus only check it for gauge.
+    if (jobConfig == null) {
+      return;
+    }
     String jobType = jobConfig.getJobType();
     jobType = preProcessJobMonitor(jobType);
     _perTypeJobMonitorMap.get(jobType).updateJobGauge(current);