genzouw / php-hdfs-client
通过webhdfs restful api将php连接到hdfs
dev-master
2019-05-28 04:08 UTC
This package is auto-updated.
Last update: 2024-09-28 16:04:01 UTC
README
这是一个从PHP访问hdfs的库。您可以使用Composer进行安装。我们使用webhdfs作为通信协议。
描述
无
示例
<?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'); }
需求
依赖关系
无。
安装
$ composer require "genzouw/php-hdfs-client:dev-master"
版本说明
本软件采用MIT许可证发布,请参阅LICENSE文件。
作者信息
- Twitter : @genzouw ( https://twitter.com/genzouw )
- Facebook : genzouw ( https://#/genzouw )
- LinkedIn : genzouw ( https://www.linkedin.com/in/genzouw/ )
- Gmail : genzouw@gmail.com