hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cavus,M.,Fa. Post Direkt" <M.Ca...@postdirekt.de>
Subject Output is null why?
Date Tue, 04 Jan 2011 10:12:01 GMT
My Outpu ist null Why? Here is my Java Code:
import java.io.IOException;

import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.util.Bytes;


public class FirstHBaseClientRead {
	public static void main(String[] args) throws IOException {
	
	HBaseConfiguration config = new HBaseConfiguration();
	
    HTable table = new HTable(config, "Table");
    
    Get get = new Get(Bytes.toBytes("FirstRowKey"));
    
   Result result = table.get(get);
   byte[] value= result.getValue(Bytes.toBytes("F1"),
Bytes.toBytes("FirstColumn"));
   System.out.println(Bytes.toString(value));
   
   
	}
}


This is my Test Table:
hbase(main):013:0> scan 'Table'
ROW                                      COLUMN+CELL

 FirstRowKey                             column=F1:Firstcolumn,
timestamp=1294132718775, value=First Value

 FirstRowKey1                            column=F1:Firstcolumn,
timestamp=1294134178724, value=First Value1

 FirstRowKey1                            column=F1:Firstcolumn1,
timestamp=1294134197574, value=First Value1

2 row(s) in 0.1030 seconds


Mime
View raw message