HBase1.0以上版本的API改变

HBase1.0以上版本已经废弃了 HTableInterface,HTable,HBaseAdminAPI的使用,新增了一些API来实现之前的功能:


Connectioninterface:

Connection connection = ConnectionFactory.createConnection(config);

// ...

connection.close();


TableName class:

String tableName = "Table";

TableName tableNameObj = TableName.valueOf(tableName);


Table,BufferedMutator, and RegionLocator interfaces:

Table table = connection.getTable(tableNameObj);

BufferedMutator mutator = connection.getBufferedMutator(tableNameObj);

RegionLocator regionLocator = connection.getRegionLocator(tableNameObj);


Admin interface:

Admin admin = connection.getAdmin();


版权声明:本文为博主原创文章,未经博主允许不得转载。

文章来自:http://blog.csdn.net/dhtx_wzgl/article/details/47448791
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3