hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Douglas (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-4151) Add a memcmp-compatible interface for key types
Date Fri, 12 Sep 2008 04:31:44 GMT

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

Chris Douglas commented on HADOOP-4151:

The findbugs warnings complain about Text and BytesWritable implementing equals, but not hashCode.
Both implementations do a type check before calling the superclass equals, which doesn't violate
the incompatibility findbugs is warning about, and remains backwards-compatible. There are
at least four ways to address the warnings, ordered as I'd prefer:
# Remove equals(Object) from both, so MemComparable::equals is used and text_inst.equals(bytesW_inst)
can return true
# Add a hashCode to both that calls super.hashCode
# Ignore the findbugs warnings
# Remove equals(Object) from both but include a type check in MemComparable::equals

Thoughts? The test failure is not related to this patch.

> Add a memcmp-compatible interface for key types
> -----------------------------------------------
>                 Key: HADOOP-4151
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4151
>             Project: Hadoop Core
>          Issue Type: Improvement
>            Reporter: Chris Douglas
>            Assignee: Chris Douglas
>            Priority: Minor
>             Fix For: 0.19.0
>         Attachments: 4151-0.patch, 4151-1.patch, 4151-2.patch
> Sometimes it's beneficial to treat types (like BytesWritable and Text) as byte arrays,
agnostic to their type. Adding an interface to tag key types as amenable to this treatment
can permit optimizations and reuse for that subset of types in tools and libraries.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message