hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "madhukara phatak (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-8549) Allow other implementation's of java.util.Map in MapWritable
Date Mon, 09 Jul 2012 07:07:35 GMT

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

madhukara phatak commented on HADOOP-8549:

Hi Harsha,
  Thanks for looking at patch. Please find my reply for the concerns raised by you.
  bq. 1. No javadocs or any other form of dev-docs seem to be present. How would others know
how to use this feature? Lets document it.
   Will add the appropriate javadoc for it once we finalize on implementation

 bq. 2. I'm -1 on relying on protected member variables directly, as thats ugly to do. Do
something similar to ArrayWritable instead, where an inheritor passes the class via a constructor.
Or at least provide getter/setter of some form.
   I tried it to make as ArrayWritable but it breaks the existing MapWritable code since implementation
 class information has to be written into stream. Even i tried setters/getters but it will
not work since in M/R code Writables are created through default constructor. So protected
member was only way i can think of solving the problem.

bq. The idea is good, but how does it work in terms of portability? If it is written by client
who used X impl. of map, and then read by another client who used Y or the default impl.,
is it guaranteed to work? If yes, lets document that guarantee. And if not, does it throw
a proper error message?

Since client has to use different class to get the new behavior (ex LinkedHashMapWritable)
and Writables are not polymorphic, portability should not be an issue.

Madhukara Phatak

> Allow other implementation's of java.util.Map in MapWritable
> ------------------------------------------------------------
>                 Key: HADOOP-8549
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8549
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: io
>    Affects Versions: 2.0.0-alpha
>            Reporter: madhukara phatak
>            Assignee: madhukara phatak
>            Priority: Minor
>         Attachments: HADOOP-8549.patch
> Current implementation of MapWritable uses HashMap as Map implementation. But in some
of the use cases we need other implementations of Map like LinkedHashMap,SortedMap.This jira
changes visibility of 'instance' in MapWritable from private to protected which allows us
to inject custom Map implementation through sub classing MapWritable  .  

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message