Return-Path: Delivered-To: apmail-hadoop-core-dev-archive@www.apache.org Received: (qmail 3540 invoked from network); 10 Sep 2008 22:27:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Sep 2008 22:27:41 -0000 Received: (qmail 22283 invoked by uid 500); 10 Sep 2008 22:27:32 -0000 Delivered-To: apmail-hadoop-core-dev-archive@hadoop.apache.org Received: (qmail 22272 invoked by uid 500); 10 Sep 2008 22:27:32 -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 22261 invoked by uid 99); 10 Sep 2008 22:27:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Sep 2008 15:27:32 -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; Wed, 10 Sep 2008 22:26:42 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 38B1D234C1D7 for ; Wed, 10 Sep 2008 15:26:44 -0700 (PDT) Message-ID: <451669183.1221085604217.JavaMail.jira@brutus> Date: Wed, 10 Sep 2008 15:26:44 -0700 (PDT) From: "Chris Douglas (JIRA)" To: core-dev@hadoop.apache.org Subject: [jira] Updated: (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:all-tabpanel ] Chris Douglas updated HADOOP-4151: ---------------------------------- Attachment: 4151-1.patch *nod* I thought about making it extend Comparable- because the type does imply that the instance can be ordered and permuted relative to these bytes- but that would force each implementor to write a (likely redundant) compare(T). What would you think of making it an abstract class, like: {code} public abstract class MemComparable implements Comparable { public abstract int getLength(); public abstract byte[] getBytes(); public int compareTo(MemComparable other) { if (this == other) return 0; return WritableComparator.compareBytes(getBytes(), 0, getLength(), other.getBytes(), 0, other.getLength()); } } {code} > 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 > > > 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.