hxy2015/yii2-hbase

为Yii框架提供Hbase集成

安装: 56

依赖关系: 0

建议者: 0

安全: 0

星标: 4

关注者: 2

分支: 1

开放性问题: 0

类型:yii2-extension

v1.1.1 2018-04-04 11:53 UTC

This package is not auto-updated.

Last update: 2024-09-19 15:27:33 UTC


README

安装此扩展的最佳方式是通过composer

运行以下命令:

php composer.phar require --prefer-dist hxy2015/yii2-hbase

或在您的composer.json文件的要求部分添加:

"hxy2015/yii2-hbase": "~1.0"

配置

要使用此扩展,您必须配置应用程序配置中的Connection类

return [
    //....
    'components' => [
        'hbase' => [
            'class' => 'hxy2015\hbase\Connection',
            'host' => 'localhost',
            'port' => '8080',
        ],
    ]
];

用法

存储数据

Yii::get('hbase')->tables()->table('user')->row('12')->put('base_info:name', 'huangxiaohu');

查询数据

# 取某一列族数据
Yii::$app->get('hbase')->tables()->table('user')->row('12')->get('base_info');

# 取某一列数据
Yii::$app->get('hbase')->tables()->table('user')->row('12')->get('base_info:name');