All Projects → sy-records → thrift2-hbase

sy-records / thrift2-hbase

Licence: MIT license
thrift2-hbase component for Hyperf.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to thrift2-hbase

Zys
high performance service framework based on Yaf or Swoole
Stars: ✭ 812 (+5700%)
Mutual labels:  thrift, swoole
hyperf-v2-demo
Hyperf Demo(easywechat,chat)
Stars: ✭ 19 (+35.71%)
Mutual labels:  swoole, hyperf
HyperVue
🚀 基于 Hyperf + Vue + ElementUI 前后端分离的通用型管理后台
Stars: ✭ 23 (+64.29%)
Mutual labels:  swoole, hyperf
Hyperf
🚀 A coroutine framework that focuses on hyperspeed and flexibility. Building microservice or middleware with ease.
Stars: ✭ 4,206 (+29942.86%)
Mutual labels:  swoole, hyperf
Node Thrift2 Hbase
An HBase thrift wrapper for Node.js
Stars: ✭ 18 (+28.57%)
Mutual labels:  hbase, thrift
MineAdmin
🎉🌈🔥MineAdmin是基于Hyperf框架 和 Vue3+Vite3 开发的前后端分离权限管理系统,自适应多终端。特色:crud生成 + json配置化开发一把梭
Stars: ✭ 142 (+914.29%)
Mutual labels:  swoole, hyperf
gotask
⚡️ A lightning speed replacement for Swoole TaskWorker in Go
Stars: ✭ 164 (+1071.43%)
Mutual labels:  swoole, hyperf
swoole-ide-helper
💪 IDE helper for Swoft and Swoole
Stars: ✭ 42 (+200%)
Mutual labels:  swoole
aaocp
一个对用户行为日志进行分析的大数据项目
Stars: ✭ 53 (+278.57%)
Mutual labels:  hbase
wasp
WASP is a framework to build complex real time big data applications. It relies on a kind of Kappa/Lambda architecture mainly leveraging Kafka and Spark. If you need to ingest huge amount of heterogeneous data and analyze them through complex pipelines, this is the framework for you.
Stars: ✭ 19 (+35.71%)
Mutual labels:  hbase
ultraman
奥特曼
Stars: ✭ 45 (+221.43%)
Mutual labels:  swoole
cbass
adding "simple" to HBase
Stars: ✭ 25 (+78.57%)
Mutual labels:  hbase
hbase-packet-inspector
Analyzes network traffic of HBase RegionServers
Stars: ✭ 35 (+150%)
Mutual labels:  hbase
hive-jdbc-driver
An alternative to the "hive standalone" jar for connecting Java applications to Apache Hive via JDBC
Stars: ✭ 31 (+121.43%)
Mutual labels:  thrift
zhamao-framework
协程、高性能、灵活的聊天机器人 & Web 开发框架(炸毛框架)
Stars: ✭ 99 (+607.14%)
Mutual labels:  swoole
homebrew-extensions
🍻 Homebrew tap for PHP extensions
Stars: ✭ 264 (+1785.71%)
Mutual labels:  swoole
netty-thrift
Thrift on Netty
Stars: ✭ 23 (+64.29%)
Mutual labels:  thrift
skeleton
基于Swoole的轻量、高效、全异步开源框架。
Stars: ✭ 71 (+407.14%)
Mutual labels:  swoole
vertica-swoole-adapter
Provides a DB layer for Swoole-based applications to communicate to HP Vertica databases.
Stars: ✭ 14 (+0%)
Mutual labels:  swoole
chubbyphp-swoole-request-handler
A request handler adapter for swoole, using PSR-7, PSR-15 and PSR-17.
Stars: ✭ 22 (+57.14%)
Mutual labels:  swoole

thrift2-hbase

thrift2-hbase component for Hyperf.

Latest Stable Version Total Downloads License PHP Version Require

此 repo 为使用阿里云云数据库 Hbase 性能增强版,HBase 增强版使用的 Thrift 接口定义是 HBase 的 thrift2

安装

composer require sy-records/thrift2-hbase -vvv

#生成 classmap
composer dump-autoload -o

在 Hyperf 中使用

配置文件

配置文件位于 config/autoload/hbase.php,如配置文件不存在可通过执行

php bin/hyperf.php vendor:publish sy-records/thrift2-hbase

命令创建默认配置,配置文件内容如下:

<?php

declare(strict_types=1);

return [
    'default' => [
        'host' => env('ALIHBASE_HOST', 'localhost'),
        'port' => env('ALIHBASE_PORT', 9190),
        'key_id' => env('ALIHBASE_KEYID', 'root'),
        'signature' => env('ALIHBASE_SIGNATURE', 'root'),
    ],
];

添加配置信息

在项目根目录.env文件中添加相关配置信息

ALIHBASE_HOST=localhost
ALIHBASE_PORT=9190
ALIHBASE_KEYID=root
ALIHBASE_SIGNATURE=root

参数说明:

配置 类型 默认值 备注
ALIHBASE_HOST string localhost 连接信息中的“非 JAVA 语言 Thrift2 访问地址”访问地址部分(注意专有网络地址和外网地址的区别)
ALIHBASE_PORT int 9190 PHP 操作端口
ALIHBASE_KEYID string root 用户名
ALIHBASE_SIGNATURE string root 密码

代码提示

在 PhpStorm 中直接操作是没有代码提示的,可添加@var使得编辑器增加代码提示,如下所示

<?php

declare(strict_types=1);

namespace App\Controller;

use Hyperf\Di\Annotation\Inject;
use Luffy\AliHbaseThrift\Service\AliHbaseThriftInterface;

class IndexController extends AbstractController
{
    /**
     * 使用注解时
     * @Inject()
     * @var AliHbaseThriftInterface
     */
    private $hbase;

    public function index()
    {
        /**
         * @var $client \Luffy\Thrift2Hbase\THBaseServiceClient
         */
        $client = $this->hbase->getClient();

        /**
         * @var $hbase \Luffy\AliHbaseThrift\Service\AliHbaseThriftService
         */
        $hbase = make(AliHbaseThriftInterface::class);

        /**
         * @var $client \Luffy\Thrift2Hbase\THBaseServiceClient
         */
        $client = $hbase->getClient();

        $res = $client->get("scanface:test", new \Luffy\Thrift2Hbase\TGet(["row" => "001"]));
        var_dump($res->columnValues);
    }
}

这样操作$client$hbase时,编辑器就会给出对应的代码提示。

在其他框架中使用

配置文件

在对应的配置文件中添加如下配置信息,参数说明见上文

return [
    'host' => "localhost",
    'port' => 9190,
    'key_id' => 'root',
    'signature' => 'root',
];

使用

$hbase = new Luffy\AliHbaseThrift\Service\AliHbaseThriftService($config['host'], $config['port'], $config['key_id'], $config['signature']);

Contributors


zhouhua

💻

沈唁

💻 📖

hejunrex

💻

starfalling

💻

扩展服务

此仓库是作为操作Hbase基础库发布的,另有完整的Hbase+Solr协程支持组件,操作更加便捷。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].