hbase1.X的部分api改变(慢慢更新)

来源:互联网 发布:秦美人天神进阶数据 编辑:程序博客网 时间:2024/05/28 06:07

以下为编码过程中出现的一些api的改变,将持续更新。

Admin

/**         *   0.X edition          * *///      HBaseAdmin admin = new HBaseAdmin(conf);//      HTableDescriptor descriptor = new HTableDescriptor();        /**         *      1.X edition         * */        Connection connection = ConnectionFactory.createConnection(conf);        Admin admin2 = connection.getAdmin();

HTableDescriptor

0.9X版本

HTableDescriptor tableDesc=new HTableDescriptor(tableName);

新的写法

HTableDescriptor table = new HTableDescriptor(TableName.valueOf("tableName"));

Htable改动

HTable hTable = new HTable(config, "tableName");-------------------------------------------------------Table hTable = connection.getTable(TableName.valueOf(tableName));
0 0