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

Alfonso Nishikawa commented on GORA-188:
----------------------------------------

Found the bug. In PersistentBase#getFieldHashCode() (at line 256) must check if 
the field is UNION and call recursively in that case to compute properly the 
hash code.
This should be put in GORA-174 patch. Do I mark this as "contained by GORA-174" 
and fix this issue there?
(Thanks!)
                
> testSerdeWebPage failure - PersistentBase#equals() fails with map fields
> ------------------------------------------------------------------------
>
>                 Key: GORA-188
>                 URL: https://issues.apache.org/jira/browse/GORA-188
>             Project: Apache Gora
>          Issue Type: Bug
>          Components: gora-core
>    Affects Versions: 0.2.1
>            Reporter: Alfonso Nishikawa
>            Assignee: Alfonso Nishikawa
>            Priority: Minor
>             Fix For: 0.3
>
>         Attachments: org.apache.gora.mapreduce.TestPersistentSerialization.txt
>
>
> As shown here:
> {code}
> junit.framework.AssertionFailedError: 
> expected:<org.apache.gora.examples.generated.WebPage@4b49ab6f {
>   "url":"http://bar.com/";
>   "content":"java.nio.HeapByteBuffer[pos=1 lim=1 cap=1]"
>   "parsedContent":"[1]"
>   "outlinks":"{http://bazbar.com=a8, http://baz.com/1.jsp&q=barbaz&p=foo=a6, 
> http://baz.com/1.jsp&q=barbaz=a5, http://bar.com/3.jsp=a3, 
> http://bar.com/1.html=a4, http://foo.com/1.html=a1, http://foo.com/2.html=a2, 
> http://baz.com/1.jsp&q=foo=a7}";
>   "metadata":"org.apache.gora.examples.generated.Metadata@51a {
>   "version":"1"
>   "data":"{metakey=metavalue}"
> }"
> }> but was:<org.apache.gora.examples.generated.WebPage@4b6d94c0 {
>   "url":"http://bar.com/";
>   "content":"java.nio.HeapByteBuffer[pos=0 lim=1 cap=1]"
>   "parsedContent":"[1]"
>   "outlinks":"{http://baz.com/1.jsp&q=barbaz=a5, 
> http://baz.com/1.jsp&q=barbaz&p=foo=a6, http://bazbar.com=a8, 
> http://bar.com/3.jsp=a3, http://foo.com/1.html=a1, http://bar.com/1.html=a4, 
> http://foo.com/2.html=a2, http://baz.com/1.jsp&q=foo=a7}";
>   "metadata":"org.apache.gora.examples.generated.Metadata@51a {
>   "version":"1"
>   "data":"{metakey=metavalue}"
> }"
> }>
>       at junit.framework.Assert.fail(Assert.java:50)
>       at junit.framework.Assert.failNotEquals(Assert.java:287)
>       at junit.framework.Assert.assertEquals(Assert.java:67)
>       at junit.framework.Assert.assertEquals(Assert.java:74)
>       at 
> org.apache.gora.util.TestIOUtils.testSerializeDeserialize(TestIOUtils.java:125)
>       at 
> org.apache.gora.mapreduce.TestPersistentSerialization.testSerdeWebPage(TestPersistentSerialization.java:85)
> {code}
> ---the difference is the order of the outlinks. I guess they should be 
> considered equal. Am I wrong?---
> -- edited: FAILS after serializing because for serialization, bytebuffer has 
> to be read and position index gets updated. This happens in 
> TestIOUtils.java:112-IOUtils.serialize(conf, dos , before, 
> (Class<T>)before.getClass());
> See comment.s

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to