2016-11-28 17 views
2

我可以使用什麼來代替已棄用的doInTable(HTableInterface表)。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); 
    } 
}); 

我正在使用Hbase的Spring Boot。

預先感謝您。

回答

0

提到的源代碼使用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 ...