hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Li Li <fancye...@gmail.com>
Subject how to calculate stop key for a scan?
Date Tue, 25 Mar 2014 03:36:23 GMT
I have two string as primary key(k1,k2)
and my row key in hbase is MD5(k1)MD5(k1)
I want to get all the rows equals k1.I can set startRowKey easily.
But How can I calculate stopRowKey?
is following correct? what if the last byte of md5 is 127? what about overflow?
any tools for this?

Scan scan=new Scan();
byte[] start=MD5(key1);
scan.setStartRow(start);
byte[] end=MD5(key1);
end[end.length-1]++
scan.setStopRow(end);

Mime
View raw message