You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Schubert Zhang <zs...@gmail.com> on 2010/12/30 04:36:33 UTC

How about to give more flexibility to RowKey (customized comparator and serializer)

In our application, we want to build a index htable to a core htable, and
the key of the index includes multiple columns in the core htable.

for example:

The core table:
RowKey -> column1, column2, column3, column4
Note:  The length of column1 and column2 is irregular.

The index table:
RowKey -> col1, col2, col3

But the RowKey of the index table is composed by column1 and column2 in the
core table.

So, I propose a following feature for HBase:
The RowKey of HBase support flexibility customization. i.e.
(1) Support used defined comparator of RowKey, then the order of rows can be
customized by user.
(2) Support used defined serializer of RowKey, then the bytes of rowkey can
be customized by user.

and i.e. maybe we can provide a following java class for RowKey:

interface RowKey implements Writable, Comparable {

}

Then application can implement its own RowKey class, and tell the HBase when
create htable.

Schubert Zhang

Re: How about to give more flexibility to RowKey (customized comparator and serializer)

Posted by Jean-Daniel Cryans <jd...@apache.org>.
This was ruled out when this jira was closed
https://issues.apache.org/jira/browse/HBASE-661

See the comments on why, feel free to post there if you think we
should include such a feature and more importantly how it can be
implemented in a way that's not adding a lot of extra complexity.

Thx,

J-D

On Thu, Dec 30, 2010 at 3:36 AM, Schubert Zhang <zs...@gmail.com> wrote:
> In our application, we want to build a index htable to a core htable, and
> the key of the index includes multiple columns in the core htable.
>
> for example:
>
> The core table:
> RowKey -> column1, column2, column3, column4
> Note:  The length of column1 and column2 is irregular.
>
> The index table:
> RowKey -> col1, col2, col3
>
> But the RowKey of the index table is composed by column1 and column2 in the
> core table.
>
> So, I propose a following feature for HBase:
> The RowKey of HBase support flexibility customization. i.e.
> (1) Support used defined comparator of RowKey, then the order of rows can be
> customized by user.
> (2) Support used defined serializer of RowKey, then the bytes of rowkey can
> be customized by user.
>
> and i.e. maybe we can provide a following java class for RowKey:
>
> interface RowKey implements Writable, Comparable {
>
> }
>
> Then application can implement its own RowKey class, and tell the HBase when
> create htable.
>
> Schubert Zhang
>