Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 06024E373 for ; Thu, 14 Feb 2013 20:35:14 +0000 (UTC) Received: (qmail 88851 invoked by uid 500); 14 Feb 2013 20:35:13 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 88798 invoked by uid 500); 14 Feb 2013 20:35:13 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 88788 invoked by uid 99); 14 Feb 2013 20:35:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Feb 2013 20:35:13 +0000 Date: Thu, 14 Feb 2013 20:35:13 +0000 (UTC) From: "Doug Meil (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HBASE-7221) RowKey utility class for rowkey construction MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-7221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Doug Meil updated HBASE-7221: ----------------------------- Attachment: hbase-common_hbase_7221_v4.patch Attaching v4 patch with requested refactoring and some other things. Changed package - org.apache.hbase.schema (formerly was in util). There are more classes and I thought adding all of it to util would be too much. Handles multiple hash-functions (now Murmur as well as MD5) Strategy pattern for data conversion (i.e., the -1/0/1 sorting issue with Bytes utility). If you want your own, you can subclass and plug in on RowKeySchema. Builder pattern on RowKeySchema. Changed RowKey to FixedLengthRowKey (this is still stateful because it has both write and read support). > RowKey utility class for rowkey construction > -------------------------------------------- > > Key: HBASE-7221 > URL: https://issues.apache.org/jira/browse/HBASE-7221 > Project: HBase > Issue Type: Improvement > Components: util > Reporter: Doug Meil > Assignee: Doug Meil > Priority: Minor > Attachments: HBASE_7221.patch, hbase-common_hbase_7221_2.patch, hbase-common_hbase_7221_v3.patch, hbase-common_hbase_7221_v4.patch > > > A common question in the dist-lists is how to construct rowkeys, particularly composite keys. Put/Get/Scan specifies byte[] as the rowkey, but it's up to you to sensibly populate that byte-array, and that's where things tend to go off the rails. > The intent of this RowKey utility class isn't meant to add functionality into Put/Get/Scan, but rather make it simpler for folks to construct said arrays. Example: > {code} > RowKey key = RowKey.create(RowKey.SIZEOF_MD5_HASH + RowKey.SIZEOF_LONG); > key.addHash(a); > key.add(b); > byte bytes[] = key.getBytes(); > {code} -- 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