eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qingwz...@apache.org
Subject eagle git commit: [EAGLE-1008] java.lang.NullPointerException in JHFEventReaderBase.close
Date Tue, 18 Apr 2017 08:44:17 GMT
Repository: eagle
Updated Branches:
  refs/heads/master cc5d23bae -> 3b66c0d3c


[EAGLE-1008] java.lang.NullPointerException in JHFEventReaderBase.close

https://issues.apache.org/jira/browse/EAGLE-1008

Author: Zhao, Qingwen <qingwzhao@apache.org>

Closes #919 from qingwen220/minor.


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

Branch: refs/heads/master
Commit: 3b66c0d3c710b7c64be7839c0246218edf806e8b
Parents: cc5d23b
Author: Zhao, Qingwen <qingwzhao@apache.org>
Authored: Tue Apr 18 16:44:11 2017 +0800
Committer: Zhao, Qingwen <qingwzhao@apache.org>
Committed: Tue Apr 18 16:44:11 2017 +0800

----------------------------------------------------------------------
 .../eagle/jpm/analyzer/mr/MRJobPerformanceAnalyzer.java | 12 ++++++++----
 .../analyzer/mr/suggestion/JobSuggestionEvaluator.java  | 12 ++++++------
 .../apache/eagle/jpm/util/jobcounter/JobCounters.java   |  3 ++-
 3 files changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/eagle/blob/3b66c0d3/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/mr/MRJobPerformanceAnalyzer.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/mr/MRJobPerformanceAnalyzer.java
b/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/mr/MRJobPerformanceAnalyzer.java
index 34365dc..cca6b18 100644
--- a/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/mr/MRJobPerformanceAnalyzer.java
+++ b/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/mr/MRJobPerformanceAnalyzer.java
@@ -61,14 +61,18 @@ public class MRJobPerformanceAnalyzer<T extends AnalyzerEntity>
implements JobAn
         Result result = new Result();
 
         for (Evaluator evaluator : evaluators) {
-            Result.EvaluatorResult evaluatorResult = evaluator.evaluate(analyzerJobEntity);
-            if (evaluatorResult != null) {
-                result.addEvaluatorResult(evaluator.getClass(), evaluatorResult);
+            try {
+                Result.EvaluatorResult evaluatorResult = evaluator.evaluate(analyzerJobEntity);
+                if (evaluatorResult != null) {
+                    result.addEvaluatorResult(evaluator.getClass(), evaluatorResult);
+                }
+            } catch (Throwable e) {
+                LOG.error("evaluator {} fails to analyse job {}", evaluator, analyzerJobEntity.getJobId(),
e);
             }
         }
 
         if (alertDeduplicator.dedup(analyzerJobEntity, result)) {
-            LOG.info("skip publish job {} alert because it is duplicated", analyzerJobEntity.getJobDefId());
+            LOG.info("skip publish job {} alert because it is duplicated", analyzerJobEntity.getJobId());
             return;
         }
 

http://git-wip-us.apache.org/repos/asf/eagle/blob/3b66c0d3/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/mr/suggestion/JobSuggestionEvaluator.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/mr/suggestion/JobSuggestionEvaluator.java
b/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/mr/suggestion/JobSuggestionEvaluator.java
index e1a357a..4e2726b 100644
--- a/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/mr/suggestion/JobSuggestionEvaluator.java
+++ b/eagle-jpm/eagle-jpm-analyzer/src/main/java/org/apache/eagle/jpm/analyzer/mr/suggestion/JobSuggestionEvaluator.java
@@ -63,7 +63,6 @@ public class JobSuggestionEvaluator implements Evaluator<MapReduceAnalyzerEntity
             return null;
         }
 
-
         if (analyzerEntity.getTotalCounters() == null) {
             LOG.warn("Total counters of Job {} is null", analyzerEntity.getJobId());
             return null;
@@ -73,13 +72,14 @@ public class JobSuggestionEvaluator implements Evaluator<MapReduceAnalyzerEntity
             return null;
         }
 
-        MapReduceJobSuggestionContext jobContext = new MapReduceJobSuggestionContext(analyzerEntity);
-        if (jobContext.getNumMaps() == 0) {
-            return null;
-        }
-
         try {
             Result.EvaluatorResult result = new Result.EvaluatorResult();
+
+            MapReduceJobSuggestionContext jobContext = new MapReduceJobSuggestionContext(analyzerEntity);
+            if (jobContext.getNumMaps() == 0) {
+                return null;
+            }
+
             for (Processor processor : loadProcessors(jobContext)) {
                 Result.ProcessorResult processorResult = processor.process(analyzerEntity);
                 if (processorResult != null) {

http://git-wip-us.apache.org/repos/asf/eagle/blob/3b66c0d3/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/jobcounter/JobCounters.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/jobcounter/JobCounters.java
b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/jobcounter/JobCounters.java
index bbb80cd..e337c13 100644
--- a/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/jobcounter/JobCounters.java
+++ b/eagle-jpm/eagle-jpm-util/src/main/java/org/apache/eagle/jpm/util/jobcounter/JobCounters.java
@@ -48,7 +48,8 @@ public final class JobCounters implements Serializable {
     }
 
     public Long getCounterValue(CounterName counterName) {
-        if (counters.get(counterName.group.name).containsKey(counterName.name)) {
+        if (counters.containsKey(counterName.group.name)
+                && counters.get(counterName.group.name).containsKey(counterName.name))
{
             return counters.get(counterName.group.name).get(counterName.name);
         } else {
             return 0L;


Mime
View raw message