Hi JG,

String.valueOf(int).getBytes() worked out with 0.19.1, It seems the
Bytes.toBytes(int) work properly with with 0.20/TRUNK.

Thanks a lot,
Ramesh



Jonathan Gray-2 wrote:
> 
> A scanner will return null if there are no rows to be returned.  Are you
> certain that your setting this up correctly?
> 
> Bytes.toBytes(int) yields the binary representation of the integer (4
> byte, big endian).
> 
> String.valueOf(int) gives the ASCII representation of the integer (after
> .getBytes() you're getting 7 characters yielding 7 bytes).
> 
> Both can be correct, but it can only be one or the other.
> 
> I recommend the first because this gives you numerical sorted order.  The
> second method will give you strange ordering with different length
> numbers, so you should use padding to get numerical ordering.
> 
> Hope that makes sense.
> 
> JG
> 
> On Wed, July 1, 2009 12:10 am, Ramesh.Ramasamy wrote:
>>
> 
>> Hi,
>>
>>
>> I'm trying to use any one of the RowFilterIntergace implementation, for
>> example PrefixRowFilter in my code.
>>
>> ('snpTbl' is the HTable reference)
>>
>>
>> int id = 3136824; PrefixRowFilter prf = new
>> PrefixRowFilter(Bytes.toBytes(id+1));
>>
>>
>> Scanner scanner = snpTbl.getScanner(Bytes.toByteArrays("info:"),
>> String.valueOf(id).getBytes(),       prf);
>>
>>
>> RowResult snpRr = scanner.next();
>>
>>
>> I'm always getting the 'snpRr' as null, May some point me out what I am
>> doing wrong?
>>
>> TIA,
>> Ramesh
>> --
>> View this message in context:
>> http://www.nabble.com/scanner.next-returns-null-tp24285200p24285200.html
>> Sent from the HBase User mailing list archive at Nabble.com.
>>
>>
>>
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/scanner.next-returns-null-tp24285200p24354701.html
Sent from the HBase User mailing list archive at Nabble.com.

Reply via email to