You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mrunit.apache.org by "Goir Riog (Commented) (JIRA)" <ji...@apache.org> on 2012/03/09 13:46:57 UTC
[jira] [Commented] (MRUNIT-70) copy(orig, conf) in Serialization
shouldn't require objects to have a no-args constructor, and copy(orig,
copy, conf) seems to violate contract for deserializer.deserialize()
[ https://issues.apache.org/jira/browse/MRUNIT-70?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13226044#comment-13226044 ]
Goir Riog commented on MRUNIT-70:
---------------------------------
We're using Hadoop with Cassandra.
This requires to use ByteBuffer objects for the key as return values from the Reducer. The ByteBuffer doesnt have a empty Constructor so we get the following exception.
java.lang.RuntimeException: java.lang.NoSuchMethodException: java.nio.HeapByteBuffer.<init>()
at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:115)
at org.apache.hadoop.mrunit.mock.MockOutputCollector.getInstance(MockOutputCollector.java:62)
at org.apache.hadoop.mrunit.mock.MockOutputCollector.deepCopy(MockOutputCollector.java:73)
at org.apache.hadoop.mrunit.mock.MockOutputCollector.collect(MockOutputCollector.java:110)
at org.apache.hadoop.mrunit.mapreduce.mock.MockReduceContextWrapper$MockReduceContext.write(MockReduceContextWrapper.java:204)
[...]
is there any patch yet ?
> copy(orig, conf) in Serialization shouldn't require objects to have a no-args constructor, and copy(orig, copy, conf) seems to violate contract for deserializer.deserialize()
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: MRUNIT-70
> URL: https://issues.apache.org/jira/browse/MRUNIT-70
> Project: MRUnit
> Issue Type: Bug
> Affects Versions: 0.8.0
> Reporter: Meloss Xeloss
> Priority: Minor
>
> The copy(orig, conf) method requires objects to have a no-args constructor, which is non-ideal, since it passes on to Deserializer.deserialize, which can create a new object if passed in null. Additionally, the contract for deserialize only _can_ fill in the object passed in, so the copy method will not perform as expected if it does not.
> http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/io/serializer/Deserializer.html#deserialize%28T%29
--
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