1,用Get方法
package hTableManagement;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.KeyValue;
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 GetRow {
/**
* @param args
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
Configuration conf = HBaseConfiguration.create();
HTable table = new HTable(conf, "ub");
Get get = new Get(Bytes.toBytes("row-1"));
get.setMaxVersions(3);
Result r = table.get(get);
System.out.println(r.size());
System.out.println(Bytes.toString(r.value()));
for(KeyValue kv : r.raw()) {
System.out.println(Bytes.toString(kv.getRow()));
System.out.println(Byte