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-919] Fix null pointer exception in JobSuggestionListener
Date Wed, 22 Feb 2017 08:48:12 GMT
Repository: eagle
Updated Branches:
  refs/heads/master 94b597b77 -> e220ae1fe


[EAGLE-919] Fix null pointer exception in JobSuggestionListener

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

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

Closes #833 from qingwen220/EAGLE-919.


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

Branch: refs/heads/master
Commit: e220ae1fe28c0698fca1987694eb2bf3e61c8ca3
Parents: 94b597b
Author: Zhao, Qingwen <qingwzhao@apache.org>
Authored: Wed Feb 22 16:48:03 2017 +0800
Committer: Zhao, Qingwen <qingwzhao@apache.org>
Committed: Wed Feb 22 16:48:03 2017 +0800

----------------------------------------------------------------------
 .../apache/eagle/storage/hbase/TestWithHBaseCoprocessor.java | 5 +++--
 .../jpm/mr/historyentity/TaskAttemptErrorCategoryEntity.java | 3 ++-
 .../eagle/jpm/mr/history/parser/JHFEventReaderBase.java      | 2 +-
 .../eagle/jpm/mr/history/parser/JobSuggestionListener.java   | 8 ++++++++
 4 files changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/eagle/blob/e220ae1f/eagle-core/eagle-query/eagle-storage-hbase/src/test/java/org/apache/eagle/storage/hbase/TestWithHBaseCoprocessor.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-storage-hbase/src/test/java/org/apache/eagle/storage/hbase/TestWithHBaseCoprocessor.java
b/eagle-core/eagle-query/eagle-storage-hbase/src/test/java/org/apache/eagle/storage/hbase/TestWithHBaseCoprocessor.java
index b647173..5ed1456 100644
--- a/eagle-core/eagle-query/eagle-storage-hbase/src/test/java/org/apache/eagle/storage/hbase/TestWithHBaseCoprocessor.java
+++ b/eagle-core/eagle-query/eagle-storage-hbase/src/test/java/org/apache/eagle/storage/hbase/TestWithHBaseCoprocessor.java
@@ -37,7 +37,7 @@ public class TestWithHBaseCoprocessor {
     protected static HBaseTestingUtility hbase;
 
     protected static String getZkZnodeParent() {
-        return "/hbase";
+        return "/hbase-test";
     }
 
     @BeforeClass
@@ -45,11 +45,12 @@ public class TestWithHBaseCoprocessor {
         System.setProperty("config.resource", "/application-co.conf");
         Configuration conf = HBaseConfiguration.create();
         conf.setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, AggregateProtocolEndPoint.class.getName());
+        conf.set("zookeeper.znode.parent", getZkZnodeParent());
         conf.setInt("hbase.master.info.port", -1);//avoid port clobbering
         conf.setInt("hbase.regionserver.info.port", -1);//avoid port clobbering
 
         int attempts = 0;
-        hbase = new HBaseTestingUtility();
+        hbase = new HBaseTestingUtility(conf);
         boolean successToStart = false;
         while (attempts < 3) {
             try {

http://git-wip-us.apache.org/repos/asf/eagle/blob/e220ae1f/eagle-jpm/eagle-jpm-entity/src/main/java/org/apache/eagle/jpm/mr/historyentity/TaskAttemptErrorCategoryEntity.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-entity/src/main/java/org/apache/eagle/jpm/mr/historyentity/TaskAttemptErrorCategoryEntity.java
b/eagle-jpm/eagle-jpm-entity/src/main/java/org/apache/eagle/jpm/mr/historyentity/TaskAttemptErrorCategoryEntity.java
index 1228f4e..8033d75 100644
--- a/eagle-jpm/eagle-jpm-entity/src/main/java/org/apache/eagle/jpm/mr/historyentity/TaskAttemptErrorCategoryEntity.java
+++ b/eagle-jpm/eagle-jpm-entity/src/main/java/org/apache/eagle/jpm/mr/historyentity/TaskAttemptErrorCategoryEntity.java
@@ -32,7 +32,8 @@ import org.apache.eagle.log.entity.meta.*;
 @TimeSeries(true)
 @Partition({"site"})
 @Indexes({
-        @Index(name = "Index_1_jobId", columns = { "jobId" }, unique = false)
+        @Index(name = "Index_1_jobId", columns = { "jobId" }, unique = false),
+        @Index(name = "Index_1_jobIdAndHost", columns = { "jobId", "hostname" }, unique =
false)
     })
 public class TaskAttemptErrorCategoryEntity extends JobBaseAPIEntity {
     @Column("a")

http://git-wip-us.apache.org/repos/asf/eagle/blob/e220ae1f/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/parser/JHFEventReaderBase.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/parser/JHFEventReaderBase.java
b/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/parser/JHFEventReaderBase.java
index 0502d1f..87d90cd 100644
--- a/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/parser/JHFEventReaderBase.java
+++ b/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/parser/JHFEventReaderBase.java
@@ -133,7 +133,7 @@ public abstract class JHFEventReaderBase extends JobEntityCreationPublisher
impl
         this.appConfig = appConfig;
         this.jobCounterMetricsGenerator = new JobCounterMetricsGenerator(appConfig.getEagleServiceConfig());
         this.jobSuggestionListener = new JobSuggestionListener(appConfig.getConfig());
-        //this.addListener(jobSuggestionListener);
+        this.addListener(jobSuggestionListener);
     }
 
     public void register(HistoryJobEntityLifecycleListener lifecycleListener) {

http://git-wip-us.apache.org/repos/asf/eagle/blob/e220ae1f/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/parser/JobSuggestionListener.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/parser/JobSuggestionListener.java
b/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/parser/JobSuggestionListener.java
index e5b0d2e..724c62c 100644
--- a/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/parser/JobSuggestionListener.java
+++ b/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/parser/JobSuggestionListener.java
@@ -89,6 +89,14 @@ public class JobSuggestionListener implements HistoryJobEntityCreationListener
{
 
     @Override
     public void flush() throws Exception {
+        if (info.getTotalCounters() == null) {
+            LOG.warn("Total counters of Job {} is null", info.getJobId());
+            return;
+        }
+        if (info.getMapCounters() == null && info.getReduceCounters() == null) {
+            LOG.warn("Map/Reduce task counters of Job {} are null", info.getJobId());
+            return;
+        }
         analyzer.analyze(info);
     }
 }


Mime
View raw message