doInTable(HTableInterface表)已弃用

时间:2016-11-28 08:40:14

标签: spring spring-boot hbase

我可以使用什么代替不推荐使用的doInTable(HTableInterface表)。

以下是代码。

hbaseTemplate.execute(tableName, new TableCallback<User>() {

    public User doInTable(HTableInterface  table) throws Throwable {

        Put p = new Put(Bytes.toBytes(KEY),timestamp);
        p.addColumn(FAMILY, XXX, Bytes.toBytes(user.getUserId()));

    table.put(p);
    }
});

我正在使用Spring Boot with Hbase。

提前谢谢。

1 个答案:

答案 0 :(得分:1)

使用org.apache.hadoop.hbase.client.Table而不是HTableInterface提到的源代码。

/**
* Used to communicate with a single HBase table.
* Obtain an instance from an {@link HConnection}.
*
* @since 0.21.0
* @deprecated use {@link org.apache.hadoop.hbase.client.Table} instead
*/
@Deprecated
@InterfaceAudience.Private
@InterfaceStability.Stable
public interface HTableInterface extends Table ...