yangh2016
 Configuration conf=new Configuration();
        String zookeeper="";
        String clientport="2181";
        String tableName="pbtest";
        String rowkey="22977609";
        conf.set(HBASE_ZOOKEEPER_QUORUM, zookeeper);
        conf.set(HBASE_ZOOKEEPER_CLINETPORT, clientport);
        conf= HBaseConfiguration.create(conf);

        Table table=null;
        try {
            Connection connection = ConnectionFactory.createConnection(conf);
            table=connection.getTable(TableName.valueOf(tableName));
        } catch (IOException e) {
            e.printStackTrace();
        }
        Get get=new Get(Bytes.toBytes(rowkey));
        Result result= null;
        try {
            result = table.get(get);
        } catch (IOException e) {
            e.printStackTrace();
        }
        Cell cell = result.getColumnLatestCell(Bytes.toBytes("cf"), Bytes.toBytes("data"));
        byte[] value = CellUtil.cloneValue(cell);

 

分类:

技术点:

相关文章:

  • 2021-11-23
  • 2021-10-05
  • 2021-10-05
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2021-10-06
猜你喜欢
  • 2021-12-05
  • 2021-07-06
  • 2021-06-02
  • 2021-06-10
  • 2021-11-13
  • 2021-10-05
  • 2021-10-05
相关资源
相似解决方案