Ejemplo n.º 1
0
  @Override
  public List<EntBasic> find(String rowkey) {
    Get get = new Get(Bytes.toBytes(rowkey));
    Scan scan = new Scan(get);

    return hbaseTemplate.find(tableName + "_" + suffix, scan, new EntBasicRowMapper());
  }
Ejemplo n.º 2
0
  @Override
  public List<String> findRowkeyByName(String name) {
    Get get = new Get(Bytes.toBytes(name));
    Scan scan = new Scan(get);

    try {
      List<String> rs =
          hbaseTemplate.find(
              indexTable + "_" + suffix,
              scan,
              new RowMapper<String>() {

                public String mapRow(Result result, int rowNum) throws Exception {
                  Map<byte[], byte[]> fs = result.getFamilyMap(F);
                  fs.entrySet();
                  return "123";
                }
              });
    } catch (Throwable t) {
      System.out.println(t);
      t.printStackTrace();
    }
    return null;
  }