hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jiraposter@reviews.apache.org (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-7328) Give more information about a missing Serializer class
Date Mon, 13 Jun 2011 19:12:52 GMT

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

jiraposter@reviews.apache.org commented on HADOOP-7328:
-------------------------------------------------------



bq.  On 2011-06-13 18:23:35, Matt Foley wrote:
bq.  > Sorry if this is out of context, but is it really best to also return a null here?
 Shouldn't it check for null result from getSerialization(), then throw a (non-NPE) exception?
 Or do you prefer to do that check and throw at a higher level of the code?
bq.  
bq.  Todd Lipcon wrote:
bq.      I thought about this while doing the review... my thinking was that our other similar
APIs do return null -eg CompressionCodecFactory.getCodecByName() returns null if the specified
codec isn't found. This API is also marked as LimitedPrivate Evolving so it shouldn't be a
problematic breaking change.
bq.      
bq.      Maybe we should add a bit of javadoc saying "@returns null if no serializer is known
for the given class." ?

The public method getSerialization() returns a null if it does not find an acceptor. I think
it is fair that a get{Serializer,Deserializer}() call do the same since they are specific
nature calls underneath?

Or we could revamp the entire set if Exceptions are better to have over null returns and null
checks, but it ought to be consistent is what I think.


- Harsh


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/884/#review817
-----------------------------------------------------------


On 2011-06-11 22:10:17, Harsh J wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/884/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2011-06-11 22:10:17)
bq.  
bq.  
bq.  Review request for hadoop-common and Todd Lipcon.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  Since getSerialization() can possibly return a null, it is only right that getSerializer()
and getDeserializer() usage functions do the same, instead of throwing up NPEs.
bq.  
bq.  Related issue to which this improvement is required: https://issues.apache.org/jira/browse/MAPREDUCE-2584
bq.  
bq.  
bq.  This addresses bug HADOOP-7328.
bq.      http://issues.apache.org/jira/browse/HADOOP-7328
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    src/java/org/apache/hadoop/io/serializer/SerializationFactory.java dee314a 
bq.  
bq.  Diff: https://reviews.apache.org/r/884/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  Existing SequenceFile serialization factory tests pass. The change is merely to make
the functions return null instead of throwing an NPE within.
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Harsh
bq.  
bq.



> Give more information about a missing Serializer class
> ------------------------------------------------------
>
>                 Key: HADOOP-7328
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7328
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: io
>    Affects Versions: 0.20.2
>            Reporter: Harsh J
>            Assignee: Harsh J
>              Labels: io, serialization
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7328.r1.diff, HADOOP-7328.r2.diff
>
>
> When you have a key/value class that's non Writable and you forget to attach io.serializers
for the same, an NPE is thrown by the tasks with no information on why or what's missing and
what led to it. I think a better exception can be thrown by SerializationFactory instead of
an NPE when a class is not found accepted by any of the loaded ones.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message