mrferos/webhdfs
Composer 安装命令:
composer require mrferos/webhdfs
包简介
WebHDFS implementation in PHP
关键字:
README 文档
README
Description
php-WebHDFS is a PHP client for WebHDFS.
Dependencies
Todo
- Write unit tests
- Consider swapping out the original Curl class for Guzzle
Usage
File and Directory Operations
Create and Write to a File
hdfs = new WebHDFS\WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username'); $hdfs->create('user/hadoop-username/new-file.txt', 'local-file.txt');
Append to a File
$hdfs = new WebHDFS\WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username'); $hdfs->append('user/hadoop-username/file-to-append-to.txt', 'local-file.txt');
Concat File(s)
$hdfs = new WebHDFS\WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username'); $hdfs->concat('user/hadoop-username/concatenated-file.txt', '/test/file1,/test/file2,/test/file3');
Open and Read a File
$hdfs = new WebHDFS\WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username'); $response = $hdfs->open('user/hadoop-username/file.txt');
Make a Directory
$hdfs = new WebHDFS\WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username'); $hdfs->mkdirs('user/hadoop-username/new/directory/structure');
Create a Symbolic Link
$hdfs = new WebHDFS\WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username'); $hdfs->createSymLink('user/hadoop-username/file.txt', '/user/hadoop-username/symlink-to-file.txt');
Rename a File/Directory
$hdfs = new WebHDFS\WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username'); $hdfs->rename('user/hadoop-username/file.txt', '/user/hadoop-username/renamed-file.txt');
Delete a File/Directory
hdfs = new WebHDFS\WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username'); $hdfs->delete('user/hadoop-username/file.txt');
Status of a File/Directory
$hdfs = new WebHDFS\WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username'); $response = $hdfs->getFileStatus('user/hadoop-username/file.txt');
List a Directory
$hdfs = new WebHDFS\WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username'); $response = $hdfs->listStatus('user/hadoop-username/');
Other File System Operations
Get Content Summary of a Directory
$hdfs = new WebHDFS\WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username'); $response = $hdfs->getContentSummary('user/hadoop-username/');
Get File Checksum
$hdfs = new WebHDFS\WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username'); $response = $hdfs->getFileChecksum('user/hadoop-username/file.txt');
Get Home Directory
$hdfs = new WebHDFS\WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username'); $response = $hdfs->getHomeDirectory();
Set Permission
$hdfs = new WebHDFS\WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username'); $hdfs->setPermission('user/hadoop-username/file.txt', '777');
Set Owner
$hdfs = new WebHDFS\WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username'); $hdfs->setOwner('user/hadoop-username/file.txt', 'other-user');
Set Replication Factor
$hdfs = new WebHDFS\WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username'); $hdfs->setReplication('user/hadoop-username/file.txt', '2');
Set Access or Modification Time
$hdfs = new WebHDFS\WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username'); $response = $hdfs->setTimes('user/hadoop-username/file.txt');
统计信息
- 总下载量: 124
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-10-30