Return-Path: Delivered-To: apmail-lucene-hadoop-dev-archive@locus.apache.org Received: (qmail 29519 invoked from network); 8 Jan 2008 19:19:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Jan 2008 19:19:58 -0000 Received: (qmail 45700 invoked by uid 500); 8 Jan 2008 19:19:47 -0000 Delivered-To: apmail-lucene-hadoop-dev-archive@lucene.apache.org Received: (qmail 45661 invoked by uid 500); 8 Jan 2008 19:19:46 -0000 Mailing-List: contact hadoop-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hadoop-dev@lucene.apache.org Delivered-To: mailing list hadoop-dev@lucene.apache.org Received: (qmail 45652 invoked by uid 99); 8 Jan 2008 19:19:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jan 2008 11:19:46 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jan 2008 19:19:42 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 14D7B714231 for ; Tue, 8 Jan 2008 11:19:34 -0800 (PST) Message-ID: <1552899.1199819974083.JavaMail.jira@brutus> Date: Tue, 8 Jan 2008 11:19:34 -0800 (PST) From: "stack (JIRA)" To: hadoop-dev@lucene.apache.org Subject: [jira] Commented: (HADOOP-2334) [hbase] VOTE: should row keys be less restrictive than hadoop.io.Text? In-Reply-To: <27226607.1196669563905.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-2334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556984#action_12556984 ] stack commented on HADOOP-2334: ------------------------------- Chatting with Dave Simpson, to protect against different clients inserting rows of different types all into the one table producing an undefined sort order because of the hodge-podge of type comparators, the key type for a table should be defined as part of table creation with an illegal type exception thrown if a client tries an update with a non-matching type. > [hbase] VOTE: should row keys be less restrictive than hadoop.io.Text? > ---------------------------------------------------------------------- > > Key: HADOOP-2334 > URL: https://issues.apache.org/jira/browse/HADOOP-2334 > Project: Hadoop > Issue Type: Wish > Components: contrib/hbase > Affects Versions: 0.16.0 > Reporter: Jim Kellerman > Assignee: Jim Kellerman > Priority: Minor > Fix For: 0.16.0 > > > I have heard from several people that row keys in HBase should be less restricted than hadoop.io.Text. > What do you think? > At the very least, a row key has to be a WritableComparable. This would lead to the most general case being either hadoop.io.BytesWritable or hbase.io.ImmutableBytesWritable. The primary difference between these two classes is that hadoop.io.BytesWritable by default allocates 100 bytes and if you do not pay attention to the length, (BytesWritable.getSize()), converting a String to a BytesWritable and vice versa can become problematic. > hbase.io.ImmutableBytesWritable, in contrast only allocates as many bytes as you pass in and then does not allow the size to be changed. > If we were to change from Text to a non-text key, my preference would be for ImmutableBytesWritable, because it has a fixed size once set, and operations like get, etc do not have to something like System.arrayCopy where you specify the number of bytes to copy. > Your comments, questions are welcome on this issue. If we receive enough feedback that Text is too restrictive, we are willing to change it, but we need to hear what would be the most useful thing to change it to as well. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.