r4j4h/php-druid-ingest
Composer 安装命令:
composer require r4j4h/php-druid-ingest
包简介
PHP Classes to wrap ingestion of data into Druid
README 文档
README
Experimental PHP wrapper around ingesting data from a variety of data sources into Druid as a data source.
Overview
The wrapper lives in the namespace PhpDruidIngest.
Classes provide for the various tasks related to the extraction, transformation, and loading of data from other sources into druid. This involves:
- the extraction, transformation, and loading of that data
- preparing it in a place and format ready for Druid
- the generation of a compatible Druid indexing task
- the execution of the indexing task
- usage of the returned job id for monitoring of the indexing task job, and
- removal of prepared ingestion data after Druid has finished ingesting the file.
When executed, this will need to live on the Druid node that will ingest the data, using LocalFilePreparer.
Otherwise it will need a way to move or stream the file from itself to the destination Node (say via scp).
RemoteSCPPreparer is an initial stab at this.
Design
- Instantiate a
IFetcher, configured to fetch the desired records for the desired time periods. - Instantiate a
IPreparerto record the results in memory or in file, tranfser results to destination, returning the destination path - Instantiate a
IDruidQueryParameters, configured with parameters. <-- was dimension definition, now index task params + path from IFetcher - Instantiate a
IDruidQueryExecutor, configured to hit a Druid endpoint. - Instantiate a
IDruidQueryGenerator. <-- index task generator - Instantiate a
IDruidQueryResponseHandler. <-- gets the task id - Run the
IDruidQueryExecutor'sexecuteQueryfunction with the IDruidQuery, getting the result. - Hand the resulting task id to
IDruidJobWatcherwho polls until task succeeds or finishes IPreparerthen cleans up left over ingestion file
Fetchers are the most interesting element in play here. By adding new Fetchers we can support new input sources.
Initially we are using mysqli to handle fetching from MySQL databases. Fetching from HTTP endpoints, or a log, or running
map/reduce or storm and getting the results results are all good ideas for other fetchers.
Please refer to this diagram for an overview of how this works underneath the hood:
(From this Dynamic LucidChart Source URL)
How to Test
From the root directory, in a command terminal run: php vendor/bin/phpunit tests or more preferably php vendor/bin/phing.
Generate Documentation
From the root directory, in a command terminal run: php vendor/bin/phing docs.
How to Install
Right now, there is no tagged version. To be ready for it when it comes, branch-aliases are in place.
- Stable branch:
~1.0@dev - Stable branch w/ PHP 5.3 Compatibility Support:
dev-php-53-compat - Cutting edge:
~1.1@dev
To install, it is suggested to use Composer. If you have it installed, then the following instructions in a composer.json should be all you need to get started:
If you are using PHP 5.3, there is a bug and you will need to use an alternative branch.
Up to date PHP:
{
"repositories": [
{
"type": "vcs",
"url": "git@github.com:r4j4h/php-druid-ingest"
}
],
"require": {
"r4j4h/php-druid-ingest": "~1.0@dev"
}
}
PHP 5.3 Compatibility:
{
"repositories": [
{
"type": "vcs",
"url": "git@github.com:r4j4h/php-druid-ingest"
}
],
"require": {
"r4j4h/php-druid-ingest": "dev-php-53-compat"
}
}
Once that is in, composer install and composer update should work.
Once those are run, require Composer's autoloader and you are off to the races:
require 'vendor/autoload.php';
References
r4j4h/php-druid-ingest 适用场景与选型建议
r4j4h/php-druid-ingest 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 62 次下载、GitHub Stars 达 4, 最近一次更新时间为 2015 年 04 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「indexing」 「druid」 「ingestion」 「overlord」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 r4j4h/php-druid-ingest 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 r4j4h/php-druid-ingest 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 r4j4h/php-druid-ingest 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Druid php client for executing queries and more
Experimental PHP wrapper around querying druid
Laravel and Lumen ElasticSearch query builder to build complex queries using an elegant syntax
A SilverStripe module to optimise the Meta, crawling, indexing, and sharing of your website content (forked from Cyber-Duck/Silverstripe-SEO)
Laravel, Lumen and Native php elasticseach query builder to build complex queries using an elegant syntax
Laravel Filament based CMS
统计信息
- 总下载量: 62
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-04-27
