Repository: hadoop
Updated Branches:
  refs/heads/branch-2 ea402c364 -> 44b3c6ffa


YARN-6738. LevelDBCacheTimelineStore should reuse ObjectMapper instances. 
Contributed by Zoltan Haindrich

(cherry picked from commit 63ce1593c5b78eb172773e7498d9c321debe81e8)


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

Branch: refs/heads/branch-2
Commit: 44b3c6ffaa9278d66c531f2c23fead0403cb88f3
Parents: ea402c3
Author: Jason Lowe <[email protected]>
Authored: Tue Jun 27 17:12:42 2017 -0500
Committer: Jason Lowe <[email protected]>
Committed: Tue Jun 27 17:13:49 2017 -0500

----------------------------------------------------------------------
 .../hadoop/yarn/server/timeline/LevelDBCacheTimelineStore.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/44b3c6ff/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/main/java/org/apache/hadoop/yarn/server/timeline/LevelDBCacheTimelineStore.java
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/main/java/org/apache/hadoop/yarn/server/timeline/LevelDBCacheTimelineStore.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/main/java/org/apache/hadoop/yarn/server/timeline/LevelDBCacheTimelineStore.java
index ccf2d94..7379dd6 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/main/java/org/apache/hadoop/yarn/server/timeline/LevelDBCacheTimelineStore.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/main/java/org/apache/hadoop/yarn/server/timeline/LevelDBCacheTimelineStore.java
@@ -286,6 +286,7 @@ public class LevelDBCacheTimelineStore extends 
KeyValueBasedTimelineStore {
         }
       };
     }
+    static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
 
     @SuppressWarnings("unchecked")
     private V getEntityForKey(byte[] key) throws IOException {
@@ -293,8 +294,7 @@ public class LevelDBCacheTimelineStore extends 
KeyValueBasedTimelineStore {
       if (resultRaw == null) {
         return null;
       }
-      ObjectMapper entityMapper = new ObjectMapper();
-      return (V) entityMapper.readValue(resultRaw, TimelineEntity.class);
+      return (V) OBJECT_MAPPER.readValue(resultRaw, TimelineEntity.class);
     }
 
     private byte[] getStartTimeKey(K entityId) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to