您的位置:首页 > 其它

HBase1.0以上版本的API改变

2015-08-12 18:28 330 查看
HBase1.0以上版本已经废弃了 HTableInterface,HTable,HBaseAdmin等API的使用,新增了一些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();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: