mrferos/zf2-webhdfs

dev-master 2014-10-31 12:39 UTC

This package is auto-updated.

Last update: 2024-09-06 09:39:39 UTC


README

安装

composer require mrferos/zf2-webhdfs:dev-master

描述

一个简单的ZF2模块,提供了一个抽象工厂来创建php-WebHDFS实例

用法

将提供的示例配置文件复制到config/autoload

cp vendor/zf2-webhdfs/config/mrfwebhdfs.global.config.php.dist config/autoload/mrfwebhdfs.global.config.php

并使用您的设置编辑文件

<?php
return array(
    'WebHDFSExample' => array(
        'username' => 'mrferos',
        'host' => 'localhost',
        'port' => 50070
    )
);

从服务管理器调用"WebHDFSExample"将返回具有您提供的配置的WebHDFS类实例。

$webhdfs = $serviceManager->get('WebHDFSExample');

如果您有多个WebHDFS端点,可以像这样定义每个端点

<?php
return array(
    'WebHDFSExample1' => array(
        'username' => 'mrferos',
        'host' => 'localhost',
        'port' => 50070
    ),
    'WebHDFSExample2' => array(
            'username' => 'mrferos',
            'host' => 'localhost',
            'port' => 50070
        )
    'WebHDFSExample3' => array(
            'username' => 'mrferos',
            'host' => 'localhost',
            'port' => 50070
        )
);

并按相同的方式调用它们,

$webhdfs1 = $serviceManager->get('WebHDFSExample1');
$webhdfs2 = $serviceManager->get('WebHDFSExample2');
$webhdfs3 = $serviceManager->get('WebHDFSExample3');