Return-Path: Delivered-To: apmail-hadoop-hbase-dev-archive@locus.apache.org Received: (qmail 82757 invoked from network); 1 Jan 2009 20:28:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Jan 2009 20:28:05 -0000 Received: (qmail 35552 invoked by uid 500); 1 Jan 2009 20:28:05 -0000 Delivered-To: apmail-hadoop-hbase-dev-archive@hadoop.apache.org Received: (qmail 35532 invoked by uid 500); 1 Jan 2009 20:28:04 -0000 Mailing-List: contact hbase-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hbase-dev@hadoop.apache.org Delivered-To: mailing list hbase-dev@hadoop.apache.org Received: (qmail 35521 invoked by uid 99); 1 Jan 2009 20:28:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jan 2009 12:28:04 -0800 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; Thu, 01 Jan 2009 20:28:04 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 43DF2234C48C for ; Thu, 1 Jan 2009 12:27:44 -0800 (PST) Message-ID: <877073290.1230841664276.JavaMail.jira@brutus> Date: Thu, 1 Jan 2009 12:27:44 -0800 (PST) From: "Michael Gottesman (JIRA)" To: hbase-dev@hadoop.apache.org Subject: [jira] Updated: (HBASE-1106) Expose getClosestRowBefore in HTable In-Reply-To: <310857797.1230841544326.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/HBASE-1106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Gottesman updated HBASE-1106: ------------------------------------- Attachment: hbase-1106.patch > Expose getClosestRowBefore in HTable > ------------------------------------ > > Key: HBASE-1106 > URL: https://issues.apache.org/jira/browse/HBASE-1106 > Project: Hadoop HBase > Issue Type: New Feature > Reporter: Michael Gottesman > Priority: Minor > Attachments: hbase-1106.patch > > > Exposes the functionality of getClosestRowBefore in HTable. It can be useful in combination with atomic check and save in the following manner to create a global auto-id creation scheme: > Presteps: > 1. In your application, have a reserved value. > 2. Create a reverse index table of your main table (best algorithm in my opinion is bitwise-not of key and append max-utf8 character) > 3. Have an offset row in said reverse index table that your application does not allow to be set (usually this will be a bitwise inverse of some prefix + maximum UTF-8 character) > Algorithm: > 1. Use getClosestRowBefore to find the last created row before the offset (which will be the last row created) > 2. Deinverse key and then increment the row key of the row returned by getClosestRowBefore > 3. Attempt to reserve the row key with checkAndSave checking if reserved has been set. > 4. If it fails try again. > Attached is a patch to expose getClosestRowBefore. Comments are of course always welcome =). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.