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 void remove() {
|
||||
}
|
||||
};
|
||||
}
|
||||
static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private V getEntityForKey(byte[] key) throws IOException {
|
||||
@ -293,8 +294,7 @@ private V getEntityForKey(byte[] key) throws IOException {
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user