hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Gottesman (JIRA)" <j...@apache.org>
Subject [jira] Created: (HBASE-1106) Expose getClosestRowBefore in HTable
Date Thu, 01 Jan 2009 20:25:44 GMT
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

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:

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)

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.

View raw message