Ah OK... In that case you can take any portion of the key and just invert all 
the bits.

For example you can have a compound key:
part1|part2, and say part2 is a date (from Date.getTime()) you just invert all 
the bits and use that as part2.
Inverting the bits is nice, because you need to know nothing about the domain 
of the key. I.e. it works for strings, longs, ints, etc.


For floating points it's a bit more tricky.


You can look at the HBaseIndex library that comes with Lily for an example.
http://www.lilyproject.org/lily/about/downloads.html, look at the 
FieldDefinition classes.


-- Lars



________________________________
From: Mark <[email protected]>
To: [email protected]
Sent: Saturday, August 20, 2011 6:29 AM
Subject: Re: Reverse timestamp

Thanks but I was more referring to reverse ordered timestamps for 
composite keys to be used for sorting purposes.

On 8/19/11 10:26 PM, lars hofhansl wrote:
> HBase maps (row-key, column family name, column, timestamp) to a value.
>
> The KeyValues are also sorted by the same attributes in reverse timestamp 
> order.
>
> The default timestamp is the current time, but you can set any long value 
> (which does not need correlate in any way to the time domain)
> as the time stamp and hence define your own ordering within multiple version 
> of the same row key.
>
> See Put: Put(byte[] row, long ts).
>
> Is that what you meant?
>
> -- Lars
>
>
>
> ________________________________
> From: Mark<[email protected]>
> To: [email protected]
> Sent: Friday, August 19, 2011 6:39 PM
> Subject: Reverse timestamp
>
> I understand the need but I don't understand how to generate a reverse 
> timestamp. Can someone please explain how this is accomplished and how I can 
> test that its working correctly?
>
> Thanks

Reply via email to