genzouw/php-hdfs-client

php to hdfs via webhdfs restfull api

dev-master 2019-05-28 04:08 UTC

This package is auto-updated.

Last update: 2024-04-28 14:57:29 UTC


README

It is a library for accessing hdfs from php. You can install using Composer. We use webhdfs as communication protocol.

Description

None

Demo

<?php
// ...

$hdfsClient = new HdfsClient('your_hdfs_namenode');

$hdfsFilePath = '/user/hive/warehouse/test.db/foo_table';

$hdfsFileContents = """\
1,2,3
4,5,6""";

$status = $hdfsClient->putFileToRemote($hdfsFilePath, $hdfsFileContents);

// Error Case!
if ($status === false || !empty(json_decode($status, true)['RemoteException']['exception'])) {
    throw new Exception('Hdfs fileput error');
}

Requirements

Dependencies

None.

Installation

$ composer require "genzouw/php-hdfs-client:dev-master"

Relase Note

date version note
2018-09-07 0.1 first release.

This software is released under the MIT License, see LICENSE.

Author Information

genzouw