hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yiqun Lin (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HDFS-11712) Ozone: Reuse ObjectMapper instance to improve the performance
Date Fri, 28 Apr 2017 05:07:04 GMT

     [ https://issues.apache.org/jira/browse/HDFS-11712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Yiqun Lin updated HDFS-11712:
-----------------------------
    Attachment: HDFS-11712-HDFS-7240.002.patch

Thanks [~anu] for taking a look!
{quote}
Do you think we can use ObjectReader or ObjectWriter in many places instead of ObjectMapper
? 
{quote}
Yes, that's also what I want to do in the new patch.
{{ObjectMapper}} is a heavy-weight object, but {{ObjectReader}} and {{ObjectWriter}} are light-weight
instances and they are fully thread-safe, reusable.
In the updated patch, I am mainly doing these three things:

* If the instance {{ObjectMapper}}, {{ObjectReader}} or {{ObjectWriter}} congigured is complete
the same, I will put that instance into the Utility class {{JsonUtils}}. It's safe to do this
since {{ObjectMapper}} or other related instances are thread safe as long as we have configured
instances before use and not changed the configuration later.
* If not, I am creating the instance in there all classes respectively and reuse the instance
in their own class.
* Upgrade all {{ObjectMapper}} APIs used in ozone, API version changed from jackson1 to jackson2.

Attach the new patch. Patch seems a little big but actually the change is minor, just a few
codes being updated and it will not take a long time to review, :).

> Ozone: Reuse ObjectMapper instance to improve the performance
> -------------------------------------------------------------
>
>                 Key: HDFS-11712
>                 URL: https://issues.apache.org/jira/browse/HDFS-11712
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: ozone
>    Affects Versions: HDFS-7240
>            Reporter: Yiqun Lin
>            Assignee: Yiqun Lin
>         Attachments: HDFS-11712-HDFS-7240.001.patch, HDFS-11712-HDFS-7240.002.patch
>
>
> In the ozone, there are many places using {{ObjectMapper}} to do the object-json transformation.
From the page of {{ObjectMapper}} (https://github.com/FasterXML/jackson-docs/wiki/Presentation:-Jackson-Performance),
{{ObjectMapper}} is a heavy-weight object, it not a good bevahiour  to create this instance
everywhere.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message