1 Star 0 Fork 0

fatrbaby / hellobase

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Hellobase

H(ello)base

installation

composer require fatrbaby/hellobase

usage

use HelloBase\Connection;

$config = [
    'host' => 'localhost',
    'port' => '9090',
    'auto_connect' => false,
    'persist' => false,
    'debug_handler' => null,
    'send_timeout' => 1000000,
    'recv_timeout' => 1000000,
    'transport' => Connection::TRANSPORT_BUFFERED,
    'protocol' => Connection::PROTOCOL_BINARY_ACCELERATED,
];

$connection = new Connection($config);
$connection->connect();

# get tables 
$connection->tables();

# get table instance
$table = $connection->table('tableName');

# put data
$table->put('row-name', ['cf:foo' => 'bar']);

# get row
$table->row('row-name', ['column1', ...]);

# get rows
$table->rows(['row-name1', 'row-name2', ...], ['column1', ...]);

# increment 
$table->increment('row-name', 'column-name', int amount)

# scan
foreach($table->scan(<startRow>, <stopRow>, <['column1', ...]>, <['condition1', ...]>) as $row => $columns) {
    // do something
}

run test

# create hbase service by docker (docker-compose)
$ cd docker
$ docker-compose up -d

# create table in docker
$ docker exec -it hbase bash
$ hbase shell

> create 'hellobase', 'hb'
> list
> quit

$ exit 

# run test
cd ../
vendor/bin/phpunit

TODO

more features

空文件

简介

hellobase is Hello HBase, An Hbase client php wrapper, via thirft. 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/fatrbaby/hellobase.git
git@gitee.com:fatrbaby/hellobase.git
fatrbaby
hellobase
hellobase
master

搜索帮助