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 "Harsh J (JIRA)" <ji...@apache.org> on 2015/02/02 03:32:35 UTC
[jira] [Commented] (HADOOP-11512) Use getTrimmedStrings when
reading serialization keys
[ https://issues.apache.org/jira/browse/HADOOP-11512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14300828#comment-14300828 ]
Harsh J commented on HADOOP-11512:
----------------------------------
Thanks again - the (1) change looks good, but the test still will not fail without the fix, making it incomplete. We need (2) done too to achieve it.
In literal terms, from the SerializationFactory object constructed at the end of your test, invoke its {{getSerializer(Text.class)}} or so, and assert that the returned object is not 'null'. This will exercise the serialization lookup and complete the test.
The current behaviour of constructing SerializationFactory with a bad config is that it still passes omitting the bad classes it finds in the configs (choosing to log them as WARNs than to throw an exception).
Let me know if this makes sense!
> Use getTrimmedStrings when reading serialization keys
> -----------------------------------------------------
>
> Key: HADOOP-11512
> URL: https://issues.apache.org/jira/browse/HADOOP-11512
> Project: Hadoop Common
> Issue Type: Bug
> Components: conf
> Affects Versions: 2.6.0
> Reporter: Harsh J
> Assignee: Ryan P
> Priority: Minor
> Attachments: HADOOP-11512.patch, HADOOP-11512.patch
>
>
> In the file {{hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/serializer/SerializationFactory.java}}, we grab the IO_SERIALIZATIONS_KEY config as Configuration#getStrings(…) which does not trim the input. This could cause confusing user issues if someone manually overrides the key in the XML files/Configuration object without using the dynamic approach.
> The call should instead use Configuration#getTrimmedStrings(…), so the whitespace is trimmed before the class names are searched on the classpath.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)