Net-Hadoop-WebHDFS

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

- overwrite :Str = "true" or "false"
- blocksize :Int
- replication :Int
- permission :Str = "0600"
- buffersize :Int

### `$client->append($path, $body, %options) :Bool`

Append _$body_ data to _$path_ file.

_%options_ might be:

- buffersize :Int

### `$client->read($path, %options) :Str`

Open file of _$path_ and returns its content. Alias: **open**.

_%options_ might be:

- offset :Int
- length :Int
- buffersize :Int

### `$client->mkdir($path, [permission => '0644']) :Bool`

Make directory _$path_ on HDFS. Alias: **mkdirs**.

### `$client->rename($path, $dest) :Bool`

Rename file or directory as _$dest_.

### `$client->delete($path, [recursive => 0/1]) :Bool`

Delete file _$path_ from HDFS. With optional _recursive => 1_, files and directories are removed recursively (default false).

### `$client->stat($path) :HashRef`

Get and returns file status object for _$path_. Alias: **getfilestatus**.

### `$client->list($path) :ArrayRef`

Get list of files in directory _$path_, and returns these status objects arrayref. Alias: **liststatus**.

### `$client->content_summary($path) :HashRef`

Get 'content summary' object and returns it. Alias: **getcontentsummary**.

### `$client->checksum($path) :HashRef`

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**.

### `$client->touchz($path) :Bool`

Create a zero length file.

### `$client->checkaccess( $path, $fsaction ) :Bool`

Test if the user has the rights to do a file system action.

### `$client->concat( $path, @source_paths ) :Bool`

Concatenate paths.

### `$client->truncate( $path, $newlength ) :Bool`

Truncate a path contents.

### `$client->delegation_token( $action, $path, @args )`

This is a method wrapping the multiple methods for delegation token
handling.

    my $token = $client->delegation_token( get => $path );
    print "Token: $token\n";

    my $milisec = $client->delegation_token( renew => $token );
    printf "Token expiration renewed until %s\n", scalar localtime $milisec / 1000;

    if ( $client->delegation_token( cancel => $token ) ) {
        print "Token cancelled. There will be a new one created.\n";
        my $token_new = $client->delegation_token( get => $path );
        print "New token: $token_new\n";
        printf "New token is %s\n", $token_new eq $token ? 'the same' : 'different';
    }
    else {
        warn "Failed to cancel token $token!";
    }

#### `$client->delegation_token( get => $path, [renewer => $username, service => $service, kind => $kind ] ) :Str )`

Returns the delegation token id for the specified path.

#### `$client->delegation_token( renew => $token ) :Int`

Returns the new expiration time for the specified delegation token in miliseconds.

#### `$client->delegation_token( cancel => $token ) :Bool`

Cancels the specified delegation token (which will force a new one to be created.



( run in 0.521 second using v1.01-cache-2.11-cpan-71847e10f99 )