hey,guy!
I would like to get the cell value via the key word like"viki" . I used
ValueFilter to implement it ,but i got nothing. Is there any other ideas?
My code as follow:
try
{
HTable htable = new
HTable(hconf,Bytes.toBytes(tablename));
ValueFilter vfilter = new
ValueFilter(CompareOp.EQUAL,new BinaryComparator(Bytes.toBytes(value)));
Scan s =new Scan();
s.setFilter(vfilter);
ResultScanner rscanner = htable.getScanner(s);
for(Result rs : rscanner)
{
byte [] by =
rs.getValue(Bytes.toBytes(tablename));
String vt= Bytes.toString(by);
System.out.println("The value is "+
vt);
}
}
catch(IOException e)
{
e.printStackTrace();
}- how to get cell value from the hbase table via the key word? ventlam
