You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "BELUGA BEHR (JIRA)" <ji...@apache.org> on 2019/02/07 04:09:00 UTC

[jira] [Comment Edited] (HADOOP-16073) Use JDK1.7 StandardCharsets

    [ https://issues.apache.org/jira/browse/HADOOP-16073?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16762339#comment-16762339 ] 

BELUGA BEHR edited comment on HADOOP-16073 at 2/7/19 4:08 AM:
--------------------------------------------------------------

[~elgoiri]

With all due respect, there is no such thing as "regular {{Charset}}".  There is a {{Charset}} class offered by Google's Guava library that existed to fill this shortcoming of the JDK.  However, now that the JDK includes this {{StandardCharsets}} class, we should be using it consistently across the project.  One could see a situation where the 3rd party library deprecates and removes this because the JDK has usurped it.  Moving everything over would isolate Hadoop from this and also encourage folks to use the JDK version moving forward if that's all they see in the code base.  There's also a minuscule memory footprint savings only having to use one instance of the UTF-8 {{Charset}}.

https://google.github.io/guava/releases/19.0/api/docs/com/google/common/base/Charsets.html


was (Author: belugabehr):
[~elgoiri]

With all due respect, there is no such thing as "regular {{Charset}}".  There is a {{Charset}} class offered by Google's Guava library that existed to fill this shortcoming of the JDK.  However, now that the JDK includes this {{StandardCharsets}} class, we should be using it consistently across the project.  One could see a situation where the 3rd party library deprecates and removes this because the JDK has usurped it.  Moving everything over would isolate Hadoop from this and also encourage folks to use the JDK version moving forward if that's all they see in the code base.  There's also a minuscule memory footprint savings only having to use one instance of the UTF-8 {{Charset}}.

> Use JDK1.7 StandardCharsets
> ---------------------------
>
>                 Key: HADOOP-16073
>                 URL: https://issues.apache.org/jira/browse/HADOOP-16073
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 3.2.0
>            Reporter: BELUGA BEHR
>            Assignee: BELUGA BEHR
>            Priority: Major
>         Attachments: HADOOP-16073.1.patch
>
>
> Use Java 1.7 [StandardCharsets|https://docs.oracle.com/javase/7/docs/api/java/nio/charset/StandardCharsets.html].  Every JDK must now include support for several common charsets.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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