Return-Path: Delivered-To: apmail-hadoop-core-dev-archive@www.apache.org Received: (qmail 55201 invoked from network); 12 Sep 2008 04:32:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Sep 2008 04:32:08 -0000 Received: (qmail 53232 invoked by uid 500); 12 Sep 2008 04:32:04 -0000 Delivered-To: apmail-hadoop-core-dev-archive@hadoop.apache.org Received: (qmail 53206 invoked by uid 500); 12 Sep 2008 04:32:04 -0000 Mailing-List: contact core-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-dev@hadoop.apache.org Received: (qmail 53195 invoked by uid 99); 12 Sep 2008 04:32:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 21:32:04 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Sep 2008 04:31:12 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 90578234C1D9 for ; Thu, 11 Sep 2008 21:31:44 -0700 (PDT) Message-ID: <1342450250.1221193904590.JavaMail.jira@brutus> Date: Thu, 11 Sep 2008 21:31:44 -0700 (PDT) From: "Chris Douglas (JIRA)" To: core-dev@hadoop.apache.org Subject: [jira] Commented: (HADOOP-4151) Add a memcmp-compatible interface for key types In-Reply-To: <1145072740.1221083324339.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ 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.