NAME

VERSION

SYNOPSIS

DESCRIPTION

This is a simple wrapper around the hdfs commandline to make them easier to call from Perl and parse their output.

The interface is partially done at the moment (see the implemented wrappers down below).

You can always use the WebHDFS to do similar operations instead of failling back to the commandline. However there are several benefits of using the cli; i) you'll end up with a single JVM invocation, so the response might be faster ii) Some functionality / endpoints might be buggy for WebHDFS but might work with the cli (for example escaping certain values is broken in some versions, but works with the cli).

NAME

Hadoop::HDFS::Command - Wrappers for various hadoop hdfs cli commands

METHODS

new

The constructor. Available attributes are listed below.

cmd_hdfs

Default value is /usr/bin/hdfs. This option needs to be altered if you have the `hdfs` command in some other place.

enable_log :Bool

Can be used to enable the internal logging feature. Disabled by default.

dfs

One of the top level commands, including an interface to the sub-commands listed below. The calling convention of the sub commands is as simple as:

ls

The @subcommand_args can have these defined: -d, -h, R.

my @rv = $hdfs->dfs( ls => @subcommand_args => $hdfs_path );

The callback can be used to prevent buffering and process the result set yourself. The callback always needs to return true to continue processing. If you want to skip some entries but continue processing then a true value needs to be returned. A bare return (which is false) will short circuit the iterator and discard any remaining records.

As a valued partner and proud supporter of MetaCPAN, StickerYou is
happy to offer a 10% discount on all Custom Stickers,
Business Labels, Roll Labels,
Vinyl Lettering or Custom Decals. StickerYou.com
is your one-stop shop to make your business stick.
Use code METACPAN10 at checkout to apply your discount.