我有以下代码。我正在尝试检索给定列族的表中的所有行。我能够获得所有行,但输出不是我所期望的。我得到一个显示密钥和时间戳但不显示值的输出。为什么不显示行的值?请帮忙。输出如下:
keyvalues={Justin/marks:total/1375104216267/Put/vlen=7/ts=0, Justin/marks:markPercentage/ 1375104186783/Put/vlen=4/ts=0}
//从hbase获取所有行的代码
public class GetHbaseData {
public static void getdata() throws IOException{
@SuppressWarnings("resource")
HTable table = new HTable(HBaseConfiguration.create(), "Student");
Scan scan = new Scan();
scan.setCaching(20);
scan.addFamily(Bytes.toBytes("marks"));
ResultScanner scanner = table.getScanner(scan);
for (Result result = scanner.next(); (result != null); result = scanner.next()) {
Get get = new Get(result.getRow());
Result entireRow = table.get(get);
System.out.println(entireRow);
}
}