hxy2015/yii2-hbase
为Yii框架提供Hbase集成
v1.1.1
2018-04-04 11:53 UTC
Requires
- ext-curl: *
- yiisoft/yii2: ~2.0.0
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');