[
https://issues.apache.org/jira/browse/HADOOP-10898?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14077604#comment-14077604
]
Eli Acherkan commented on HADOOP-10898:
---------------------------------------
Proposed patch attached and ready for review. It adds cleanup of the
classToIdMap/idToClassMap data structures in AbstractMapWritable.readFields,
and a new unit test in TestMapWritable. The initialization of the
classToIdMap/idToClassMap maps in AbstractMapWritable was extracted to a
separate method, addDefaultsToMap.
> MapWritable instances cannot be reused when containing different custom
> Writable classes.
> -----------------------------------------------------------------------------------------
>
> Key: HADOOP-10898
> URL: https://issues.apache.org/jira/browse/HADOOP-10898
> Project: Hadoop Common
> Issue Type: Bug
> Components: io
> Reporter: Eli Acherkan
> Priority: Minor
> Attachments: HADOOP-10898.patch
>
>
> When a data stream contains several MapWritable instances, which contain
> instances of several different custom classes (implementing Writable),
> attempting to reuse a single MapWritable instance for reading the data stream
> results in an IllegalArgumentException. This happens because
> AbstractMapWritable.readFields doesn't reset the classToIdMap/idToClassMap
> data structures.
--
This message was sent by Atlassian JIRA
(v6.2#6252)