hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Rawson <ryano...@gmail.com>
Subject Re: Lastest timestamp of a column
Date Sun, 26 Sep 2010 20:08:54 GMT
if you only are expecting 1 column in the result, then you can access
the KeyValue raw, eg:

KeyValue [] kvs = result.raw();
assert(kvs.length == 1);
KeyValue myKV = kvs[0];
byte[] row = myKV.getRow();
long timestamp = myKV.getTimestamp();

etc

The Result interface could probably use with a few more user friendly
APIs, do you have any ideas?

-ryan

On Sun, Sep 26, 2010 at 4:56 AM, Uli Köhler <ulikoehler@online.de> wrote:
> Hi all,
> I have the following problem:
> I've got a single column which is guaranteed to exist and I need to get the
> latest timestamp of this column
> The only solution I found yet is:
>
> result.getMap().get(INFO_CF).get(TITLE_KEY).lowerKey(Long.MAX_VALUE);
>
> This looks quite ugly - and I'm pretty sure that it isn't very fast.
>
> I'm using Cloudera's HBase 0.89.20100621+17.
>
> I would be very grateful for any suggestions!
>
> Best regards,
> Uli Köhler
>

Mime
View raw message