Using Java classes itself is possible from within HBase shell (since
it is JRuby), but yes some Ruby knowledge should be helpful too!

For instance, I can use java.lang.String by simply importing it:

hbase(main):004:0> import java.lang.String
=> Java::JavaLang::String
hbase(main):004:0> get String.new('test'), String.new('row1')
COLUMN                                 CELL

 f:a                                   timestamp=1300170063837, value=val4

1 row(s) in 0.0420 seconds

On Wed, Mar 16, 2011 at 4:26 PM, Eric Charles
<[email protected]> wrote:
> Hi,
> I understand from your answer that it's possible but not available.
> Did anyone already implemented such a functionality?
> If not, where should I begin to look at (hirb.rb, any tutorial,... ?) - I
> know nothing about jruby.
> Tks,
> - Eric
>
> On 16/03/2011 10:39, Harsh J wrote:
>>
>> (For 2) I think the hash function should work in the shell if it
>> returns a string type (like what '' defines in-place).
>>
>> On Wed, Mar 16, 2011 at 2:22 PM, Eric Charles
>> <[email protected]>  wrote:
>>>
>>> Hi,
>>>
>>> To help avoid hotspots, I'm planning to use hashed keys in some tables.
>>>
>>> 1. I wonder if this strategy is adviced for range queries (from/to key)
>>> use
>>> case, because the rows will be randomly distributed in different regions.
>>> Will it cause some performance loose?
>>> 2. Is it possible to query from hbase shell with something like "get
>>> 't1',
>>> @hash('r1')", to let the shell compute the hash for you from the readable
>>> key.
>>> 3. There are MD5 and Jenkins classes in hbase.util package. What would
>>> you
>>> advice? what about SHA1?
>>>
>>> Tks,
>>> - Eric
>>>
>>> PS: I searched the archive but didn't find the answers.
>>>
>>>
>>
>>
>
>



-- 
Harsh J
http://harshj.com

Reply via email to