YARN-6738. LevelDBCacheTimelineStore should reuse ObjectMapper instances. Contributed by Zoltan Haindrich
This commit is contained in:
parent
bc4dfe9c9c
commit
63ce1593c5
|
@ -286,6 +286,7 @@ public class LevelDBCacheTimelineStore extends KeyValueBasedTimelineStore {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private V getEntityForKey(byte[] key) throws IOException {
|
private V getEntityForKey(byte[] key) throws IOException {
|
||||||
|
@ -293,8 +294,7 @@ public class LevelDBCacheTimelineStore extends KeyValueBasedTimelineStore {
|
||||||
if (resultRaw == null) {
|
if (resultRaw == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
ObjectMapper entityMapper = new ObjectMapper();
|
return (V) OBJECT_MAPPER.readValue(resultRaw, TimelineEntity.class);
|
||||||
return (V) entityMapper.readValue(resultRaw, TimelineEntity.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte[] getStartTimeKey(K entityId) {
|
private byte[] getStartTimeKey(K entityId) {
|
||||||
|
|
Loading…
Reference in New Issue