hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject Re: checkAndPut with comparators
Date Tue, 02 Jul 2013 23:42:18 GMT
>From HRegionServer#mutate(), you can find:

          CompareOp compareOp =
CompareOp.valueOf(condition.getCompareType().name());

          ByteArrayComparable comparator =

            ProtobufUtil.toComparator(condition.getComparator());

...

            boolean result = region.checkAndMutate(row, family,

              qualifier, compareOp, comparator, put, true);

WritableByteArrayComparator is no longer used.

Cheers
On Tue, Jul 2, 2013 at 4:11 PM, Rob Roland <rob@simplymeasured.com> wrote:

> Hi,
>
> I see that in HBASE-3468, we gained the ability to do a checkAndPut with a
> comparator, but it doesn't look straightforward to use from a client
> perspective.
>
> I'd like to create/submit a patch that would do the following:
>
> Add new WritableByteArrayComparator instances - LongComparator,
> IntComparator, DoubleComparator, FloatComparator, ShortComparator,
> StringComparator. Pretty much helpers for everything that the Bytes class
> can convert to a byte[].
>
> Add a method to HTableInterface / HTable:
>
>     boolean checkAndPut(byte[] row, byte[] family, byte[] qualifier,
>                         final CompareFilter.CompareOp compareOp,
>                         final WritableByteArrayComparable comparator,
>                         Put put) throws IOException;
>
> and the corresponding delete:
>
>     boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier,
>                         final CompareFilter.CompareOp compareOp,
>                         final WritableByteArrayComparable comparator,
>                         Delete delete) throws IOException;
>
> Before I get started on that, have I missed anything?
>
> I'm looking at the code in trunk and it's a bit different than the last
> time I submitted a patch, so this is going to take a bit. :)
>
> Thanks,
>
> Rob Roland
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message