6.8 获取某一行数据
private static void getRowData(String tableName, String row) throws IOException {
Table table = conn.getTable(TableName.valueOf(tableName));
Get get = new Get(Bytes.toBytes(row));
Result result = table.get(get);
List<Cell> cells = result.listCells();
for (Cell cell : cells) {
String family = Bytes.toString(CellUtil.cloneFamily(cell));
String value = Bytes.toString(CellUtil.cloneValue(cell));
String rowName = Bytes.toString(CellUtil.cloneRow(cell));
String column = Bytes.toString(CellUtil.cloneQualifier(cell));
System.out.println("column = " + column);
System.out.println("rowName = " + rowName);
System.out.println("value = " + value);
System.out.println("family = " + family);
}
}