Example #1
0
  public static void main(String[] args) throws IOException {
    Configuration conf = HBaseConfiguration.create();
    HTableInterface literaturesTable = new HTable(conf, "pb_literatures");

    Scan s = new Scan();
    s.addFamily(Bytes.toBytes("info"));
    ResultScanner rs = literaturesTable.getScanner(s);
    for (Result r : rs) {
      byte[] b = r.getValue(Bytes.toBytes("info"), Bytes.toBytes("title"));
      System.out.println(Bytes.toString(b));
    }
  }