Net-Hadoop-WebHDFS
view release on metacpan or search on metacpan
Get checksum information object for _$path_. Alias: **getfilechecksum**.
### `$client->homedir() :Str`
Get accessing user's home directory path. Alias: **gethomedirectory**.
### `$client->chmod($path, $mode) :Bool`
Set permission of _$path_ as octal _$mode_. Alias: **setpermission**.
### `$client->chown($path, [owner => 'username', group => 'groupname']) :Bool`
Set owner or group of _$path_. One of owner/group must be specified. Alias: **setowner**.
### `$client->replication($path, $replnum) :Bool`
Set replica number for _$path_. Alias: **setreplication**.
### `$client->touch($path, [modificationtime => $mtime, accesstime => $atime]) :Bool`
Set mtime/atime of _$path_. Alias: **settimes**.
lib/Net/Hadoop/WebHDFS.pm view on Meta::CPAN
my $err = $self->check_options('SETPERMISSION', %options);
croak $err if $err;
my $res = $self->operate_requests('PUT', $path, 'SETPERMISSION', {%options, permission => $mode});
$res->{code} == 200;
}
sub setpermission { (shift)->chmod(@_); }
# curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETOWNER
# [&owner=<USER>][&group=<GROUP>]"
sub chown {
my ($self, $path, %options) = @_;
my $err = $self->check_options('SETOWNER', %options);
croak $err if $err;
unless (defined($options{owner}) or defined($options{group})) {
croak "'chown' needs at least one of owner or group";
}
my $res = $self->operate_requests('PUT', $path, 'SETOWNER', \%options);
$res->{code} == 200;
}
$OPT_TABLE{SETOWNER} = ['owner', 'group'];
sub setowner { (shift)->chown(@_); }
# curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETREPLICATION
# [&replication=<SHORT>]"
sub replication {
my ($self, $path, $replnum, %options) = @_;
my $err = $self->check_options('SETREPLICATION', %options);
croak $err if $err;
my $res = $self->operate_requests('PUT', $path, 'SETREPLICATION', {%options, replication => $replnum});
$self->check_success_json($res, 'boolean');
lib/Net/Hadoop/WebHDFS.pm view on Meta::CPAN
Get checksum information object for I<$path>. Alias: B<getfilechecksum>.
=head3 C<< $client->homedir() :Str >>
Get accessing user's home directory path. Alias: B<gethomedirectory>.
=head3 C<< $client->chmod($path, $mode) :Bool >>
Set permission of I<$path> as octal I<$mode>. Alias: B<setpermission>.
=head3 C<< $client->chown($path, [owner => 'username', group => 'groupname']) :Bool >>
Set owner or group of I<$path>. One of owner/group must be specified. Alias: B<setowner>.
=head3 C<< $client->replication($path, $replnum) :Bool >>
Set replica number for I<$path>. Alias: B<setreplication>.
=head3 C<< $client->touch($path, [modificationtime => $mtime, accesstime => $atime]) :Bool >>
Set mtime/atime of I<$path>. Alias: B<settimes>.
( run in 0.697 second using v1.01-cache-2.11-cpan-71847e10f99 )