hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tsuna <tsuna...@gmail.com>
Subject Re: UUID as key wuz: RE: worth choosing the shortest possible column names/keys?
Date Mon, 15 Mar 2010 16:13:01 GMT
On Mon, Mar 15, 2010 at 12:21 AM, Tim Robertson
<timrobertson100@gmail.com> wrote:
> How do you use incrementColumnValue
> To generate a row key please?

You need a "special" row to act as a counter.  This row will typically
contain only a single cell, which stores the counter.  I like to use
the row key { 0 } (a byte array made of a single zeroed byte) for this
special row.  Then you just do an incrementColumnValue on that cell,
and the long you get back, you can transform to a byte array and here
you go, you got your row key.  The counter row is only special in the
sense that it doesn't store actual data, but only a small piece of
meta data that the counter is.

Beware that this entails that all the new rows are always appended at
the end of the same region.  If your workload's performance depends on
your ability to create a large number of rows per second, then this
technique may prove inefficient as you may create a hot spot on the
one region that is being written to.

Benoit "tsuna" Sigoure
Software Engineer @ www.StumbleUpon.com

View raw message