[
https://issues.apache.org/jira/browse/MAPREDUCE-6626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15132219#comment-15132219
]
Akira AJISAKA commented on MAPREDUCE-6626:
------------------------------------------
Thanks [~linyiqun] for working on this. Two comments from me.
1. {code}
- ObjectMapper mapper = new ObjectMapper();
- ArrayNode nodes = mapper.createArrayNode();
+ ArrayNode nodes = MAPPER.createArrayNode();
{code}
Can we replace {{ObjectMapper}} with {{JsonNodeFactory}}?
2. {code}
- ObjectMapper mapper = new ObjectMapper();
Map<String, String> nm =
- mapper.readValue(new File(localFileName), Map.class);
+ MAPPER.readValue(new File(localFileName), Map.class);
{code}
Can we replace {{ObjectMapper}} with {{ObjectReader}}?
{{ObjectMapper}} instance is relatively heavy, so avoid using it as possible.
> Reuse objectMapper instance in MapReduce
> ----------------------------------------
>
> Key: MAPREDUCE-6626
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-6626
> Project: Hadoop Map/Reduce
> Issue Type: Improvement
> Components: performance
> Affects Versions: 2.7.1
> Reporter: Lin Yiqun
> Assignee: Lin Yiqun
> Attachments: MAPREDUCE-6626.002.patch, MAPREDUCE-6626.003.patch,
> MAPREDUCE.001.patch
>
>
> Now in MapReduce, there are some places creating a new ObjectMapper instance
> every time. In wiki of ObjectMapper, it suggested:
> {code}
> Further: it is beneficial to use just one instance (or small number of
> instances) for data binding; many optimizations for reuse (of symbol tables,
> some buffers) depend on ObjectMapper instances being reused.
> {code}
> http://webcache.googleusercontent.com/search?q=cache:kybMTIJC6F4J:wiki.fasterxml.com/JacksonFAQ+&cd=4&hl=ja&ct=clnk&gl=jp,
> it's similar to HDFS-9724.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)