SortedMapWritable: inkonsistent put() and putAll() behaviour
------------------------------------------------------------
Key: HADOOP-5028
URL: https://issues.apache.org/jira/browse/HADOOP-5028
Project: Hadoop Core
Issue Type: Bug
Affects Versions: 0.19.0
Reporter: Stefan Podkowinski
The current SortedMapWritable implementation is breaking support for custom
classes in case putAll() is used. Its important for putAll() that addToMap()
will called to register all used classes. Please consider to have putAll() call
put() for each map entry.
trunk:
public Writable put(WritableComparable key, Writable value) {
addToMap(key.getClass());
addToMap(value.getClass());
return instance.put(key, value);
}
public void putAll(Map<? extends WritableComparable, ? extends Writable> t) {
for (Map.Entry<? extends WritableComparable, ? extends Writable> e:
t.entrySet()) {
instance.put(e.getKey(), e.getValue());
}
}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.