hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From haiboc...@apache.org
Subject [49/50] [abbrv] hadoop git commit: YARN-6649. RollingLevelDBTimelineServer throws RuntimeException if object decoding ever fails runtime exception. Contributed by Jon Eagles.
Date Wed, 31 May 2017 22:43:24 GMT
YARN-6649. RollingLevelDBTimelineServer throws RuntimeException if object decoding ever fails
runtime exception. Contributed by Jon Eagles.


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

Branch: refs/heads/YARN-1011
Commit: 4369690ce63566131aee28696bf2683a3cb20205
Parents: 1543d0f
Author: Nathan Roberts <nroberts@apache.org>
Authored: Tue May 30 16:10:33 2017 -0500
Committer: Nathan Roberts <nroberts@apache.org>
Committed: Wed May 31 11:32:32 2017 -0500

----------------------------------------------------------------------
 .../timeline/RollingLevelDBTimelineStore.java   | 29 ++++++++++++++++----
 1 file changed, 23 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/4369690c/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/timeline/RollingLevelDBTimelineStore.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/timeline/RollingLevelDBTimelineStore.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/timeline/RollingLevelDBTimelineStore.java
index 20e0379..d139346 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/timeline/RollingLevelDBTimelineStore.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/timeline/RollingLevelDBTimelineStore.java
@@ -473,9 +473,16 @@ public class RollingLevelDBTimelineStore extends AbstractService implements
         }
       } else if (key[prefixlen] == OTHER_INFO_COLUMN[0]) {
         if (otherInfo) {
-          entity.addOtherInfo(
-              parseRemainingKey(key, prefixlen + OTHER_INFO_COLUMN.length),
-              fstConf.asObject(iterator.peekNext().getValue()));
+          Object o = null;
+          String keyStr = parseRemainingKey(key,
+              prefixlen + OTHER_INFO_COLUMN.length);
+          try {
+            o = fstConf.asObject(iterator.peekNext().getValue());
+            entity.addOtherInfo(keyStr, o);
+          } catch (Exception e) {
+            LOG.warn("Error while decoding "
+                + entityId + ":otherInfo:" + keyStr, e);
+          }
         }
       } else if (key[prefixlen] == RELATED_ENTITIES_COLUMN[0]) {
         if (relatedEntities) {
@@ -1338,7 +1345,12 @@ public class RollingLevelDBTimelineStore extends AbstractService implements
       TimelineEvent event = new TimelineEvent();
       event.setTimestamp(ts);
       event.setEventType(tstype);
-      Object o = fstConf.asObject(value);
+      Object o = null;
+      try {
+        o = fstConf.asObject(value);
+      } catch (Exception e) {
+        LOG.warn("Error while decoding " + tstype, e);
+      }
       if (o == null) {
         event.setEventInfo(null);
       } else if (o instanceof Map) {
@@ -1362,8 +1374,13 @@ public class RollingLevelDBTimelineStore extends AbstractService implements
     KeyParser kp = new KeyParser(key, offset);
     String name = kp.getNextString();
     byte[] bytes = kp.getRemainingBytes();
-    Object value = fstConf.asObject(bytes);
-    entity.addPrimaryFilter(name, value);
+    Object value = null;
+    try {
+      value = fstConf.asObject(bytes);
+      entity.addPrimaryFilter(name, value);
+    } catch (Exception e) {
+      LOG.warn("Error while decoding " + name, e);
+    }
   }
 
   /**


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message