eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinh...@apache.org
Subject eagle git commit: [MINOR] fix job error mapping flush bug
Date Wed, 22 Feb 2017 01:56:20 GMT
Repository: eagle
Updated Branches:
  refs/heads/master 271fa7ff5 -> c0198a0ce


[MINOR] fix job error mapping flush bug

Author: wujinhu <wujinhu920@126.com>

Closes #832 from wujinhu/EAGLE-845.


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

Branch: refs/heads/master
Commit: c0198a0cea7d3aca506b3252b045e24ce90f5921
Parents: 271fa7f
Author: wujinhu <wujinhu920@126.com>
Authored: Wed Feb 22 09:56:16 2017 +0800
Committer: wujinhu <wujinhu920@126.com>
Committed: Wed Feb 22 09:56:16 2017 +0800

----------------------------------------------------------------------
 .../parser/JobEntityCreationEagleServiceListener.java       | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/eagle/blob/c0198a0c/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/parser/JobEntityCreationEagleServiceListener.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/parser/JobEntityCreationEagleServiceListener.java
b/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/parser/JobEntityCreationEagleServiceListener.java
index 2f77456..fd19c11 100644
--- a/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/parser/JobEntityCreationEagleServiceListener.java
+++ b/eagle-jpm/eagle-jpm-mr-history/src/main/java/org/apache/eagle/jpm/mr/history/parser/JobEntityCreationEagleServiceListener.java
@@ -50,6 +50,7 @@ public class JobEntityCreationEagleServiceListener implements HistoryJobEntityCr
     List<TaskExecutionAPIEntity> taskExecs = new ArrayList<>();
     List<TaskAttemptExecutionAPIEntity> taskAttemptExecs = new ArrayList<>();
     List<TaskAttemptErrorCategoryEntity> taskAttemptErrors = new ArrayList<>();
+    List<JobErrorCategoryMappingAPIEntity> jobErrorMappings = new ArrayList<>();
     private JobExecutionMetricsCreationListener jobExecutionMetricsCreationListener = new
JobExecutionMetricsCreationListener();
     private TimeZone timeZone;
     private MRHistoryJobConfig appConfig;
@@ -125,6 +126,8 @@ public class JobEntityCreationEagleServiceListener implements HistoryJobEntityCr
                 }
             } else if (entity instanceof TaskAttemptErrorCategoryEntity) {
                 taskAttemptErrors.add((TaskAttemptErrorCategoryEntity) entity);
+            } else if (entity instanceof JobErrorCategoryMappingAPIEntity) {
+                jobErrorMappings.add((JobErrorCategoryMappingAPIEntity) entity);
             }
         }
         GenericServiceAPIResponseEntity result;
@@ -164,6 +167,12 @@ public class JobEntityCreationEagleServiceListener implements HistoryJobEntityCr
             checkResult(result);
             taskAttemptErrors.clear();
         }
+        if (jobErrorMappings.size() > 0) {
+            logger.info("flush JobErrorCategoryMappingAPIEntity of number " + jobErrorMappings.size());
+            result = client.create(jobErrorMappings);
+            checkResult(result);
+            jobErrorMappings.clear();
+        }
 
         logger.info("finish flushing entities of total number " + list.size());
         list.clear();


Mime
View raw message