承接 r4j4h/php-druid-ingest 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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:

  1. the extraction, transformation, and loading of that data
  2. preparing it in a place and format ready for Druid
  3. the generation of a compatible Druid indexing task
  4. the execution of the indexing task
  5. usage of the returned job id for monitoring of the indexing task job, and
  6. 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

  1. Instantiate a IFetcher, configured to fetch the desired records for the desired time periods.
  2. Instantiate a IPreparer to record the results in memory or in file, tranfser results to destination, returning the destination path
  3. Instantiate a IDruidQueryParameters, configured with parameters. <-- was dimension definition, now index task params + path from IFetcher
  4. Instantiate a IDruidQueryExecutor, configured to hit a Druid endpoint.
  5. Instantiate a IDruidQueryGenerator. <-- index task generator
  6. Instantiate a IDruidQueryResponseHandler. <-- gets the task id
  7. Run the IDruidQueryExecutor's executeQuery function with the IDruidQuery, getting the result.
  8. Hand the resulting task id to IDruidJobWatcher who polls until task succeeds or finishes
  9. IPreparer then 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:

Process Flow

(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:

  1. 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 我们能提供哪些服务?
定制开发 / 二次开发

基于 r4j4h/php-druid-ingest 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 62
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 19
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-27