You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by st...@apache.org on 2017/06/30 14:59:51 UTC
[10/35] hadoop git commit: YARN-6738. LevelDBCacheTimelineStore
should reuse ObjectMapper instances. Contributed by Zoltan Haindrich
YARN-6738. LevelDBCacheTimelineStore should reuse ObjectMapper instances. Contributed by Zoltan Haindrich
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/63ce1593
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/63ce1593
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/63ce1593
Branch: refs/heads/HADOOP-13345
Commit: 63ce1593c5b78eb172773e7498d9c321debe81e8
Parents: bc4dfe9
Author: Jason Lowe <jl...@yahoo-inc.com>
Authored: Tue Jun 27 17:12:42 2017 -0500
Committer: Jason Lowe <jl...@yahoo-inc.com>
Committed: Tue Jun 27 17:12:42 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/63ce1593/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: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org