Hadoop-HDFS-Command

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

         "requires" : {
            "Capture::Tiny" : "0",
            "Carp" : "0",
            "Data::Dumper" : "0",
            "DateTime" : "0",
            "DateTime::Format::Strptime" : "0",
            "Getopt::Long" : "0",
            "IPC::Cmd" : "0",
            "IPC::Open3" : "0",
            "Moo" : "0",
            "Ref::Util" : "0",
            "Time::HiRes" : "0",
            "Types::Standard" : "0",
            "perl" : "5.010",
            "strict" : "0",
            "warnings" : "0"
         }
      },
      "test" : {
         "recommends" : {
            "CPAN::Meta" : "2.120900"

META.yml  view on Meta::CPAN

requires:
  Capture::Tiny: '0'
  Carp: '0'
  Data::Dumper: '0'
  DateTime: '0'
  DateTime::Format::Strptime: '0'
  Getopt::Long: '0'
  IPC::Cmd: '0'
  IPC::Open3: '0'
  Moo: '0'
  Ref::Util: '0'
  Time::HiRes: '0'
  Types::Standard: '0'
  perl: '5.010'
  strict: '0'
  warnings: '0'
resources:
  bugtracker: https://github.com/Perl-Hadoop/Hadoop-HDFS-Command/issues
  repository: git://github.com/Perl-Hadoop/Hadoop-HDFS-Command.git
version: '0.007'
x_contributors:

Makefile.PL  view on Meta::CPAN

  "PREREQ_PM" => {
    "Capture::Tiny" => 0,
    "Carp" => 0,
    "Data::Dumper" => 0,
    "DateTime" => 0,
    "DateTime::Format::Strptime" => 0,
    "Getopt::Long" => 0,
    "IPC::Cmd" => 0,
    "IPC::Open3" => 0,
    "Moo" => 0,
    "Ref::Util" => 0,
    "Time::HiRes" => 0,
    "Types::Standard" => 0,
    "strict" => 0,
    "warnings" => 0
  },
  "TEST_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0,
    "File::Spec" => 0,
    "IO::Handle" => 0,
    "IPC::Open3" => 0,

Makefile.PL  view on Meta::CPAN

  "Data::Dumper" => 0,
  "DateTime" => 0,
  "DateTime::Format::Strptime" => 0,
  "ExtUtils::MakeMaker" => 0,
  "File::Spec" => 0,
  "Getopt::Long" => 0,
  "IO::Handle" => 0,
  "IPC::Cmd" => 0,
  "IPC::Open3" => 0,
  "Moo" => 0,
  "Ref::Util" => 0,
  "Test::More" => 0,
  "Time::HiRes" => 0,
  "Types::Standard" => 0,
  "strict" => 0,
  "warnings" => 0
);


unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
  delete $WriteMakefileArgs{TEST_REQUIRES};

dist.ini  view on Meta::CPAN

[AutoPrereqs]
[Prereqs]
perl                       = 5.010

Capture::Tiny              = 0
DateTime                   = 0
DateTime::Format::Strptime = 0
IPC::Cmd                   = 0
IPC::Open3                 = 0
Moo                        = 0
Ref::Util                  = 0
Types::Standard            = 0

[ExecDir]
[ShareDir]

[GitHub::Meta]

[Meta::Contributors]
contributor = Burak Gursoy <burak@cpan.org>

lib/Hadoop/HDFS/Command.pm  view on Meta::CPAN

use 5.010;
use strict;
use warnings;
use Capture::Tiny   ();
use Carp            ();
use Data::Dumper;
use DateTime::Format::Strptime;
use DateTime;
use Getopt::Long    ();
use IPC::Cmd        ();
use Ref::Util       ();
use Time::HiRes   qw( time );
use Types::Standard qw(Bool Str);

{ use Moo; }

has cmd_hdfs => (
    is  => 'rw',
    isa => sub {
        my $val = shift;
        return if $val && -e $val && -x _;

lib/Hadoop/HDFS/Command.pm  view on Meta::CPAN


before ['_capture', '_capture_with_stdin'] => sub {
    my ($self, $options, @cmd) = @_;
    unshift @cmd, 'sudo', '-u', $self->runas
        unless $self->runas eq getpwuid $<;
    @_ = ($self, $options, @cmd);
};

sub dfs {
    my $self = shift;
    my $options = Ref::Util::is_hashref $_[0] ? shift( @_ ) : {};
    (my $cmd    = shift || die "No dfs command specified") =~ s{ \A [-]+ }{}xms;
    my $method  = '_dfs_' . $cmd;
    Carp::croak "'$cmd' is not implemented!" if ! $self->can( $method );
    $self->$method( $options, @_ );
}

sub _dfs_ls {
    my $self = shift;
    state $strp;

lib/Hadoop/HDFS/Command.pm  view on Meta::CPAN

                            undef,
                            {
                                require_params => 1,
                            },
                        );

    my $want_epoch = $options->{want_epoch};
    my $cb = delete $options->{callback};

    if ( $cb ) {
        die "callback needs to be a CODE" if ! Ref::Util::is_coderef $cb;
        if ( defined wantarray ) {
            Carp::croak "You need to call this function in void context when callback is specified";
        }
    }

    my @response = $self->_capture(
        $options,
        $self->cmd_hdfs,
        qw( dfs -ls ),
        ( map { '-' . $_ } grep { $arg->{ $_ } } @flags ),

lib/Hadoop/HDFS/Command.pm  view on Meta::CPAN

    # -archives <comma separated list of archives>    specify comma separated archives to be unarchived on the compute machines.

    my($params, $flags, $opt, $conf) = @_;
    $conf ||= {};
    my @params = map { $_ eq '-' ? '\-' : $_ } @{ $params };

    my @getopt_args = (
        \@params,
        \my %arg,
        (
            map { Ref::Util::is_arrayref $_ ? @{ $_ } : () }
                $flags,
                $opt,
        ),
    );

    if  ( $self->trace_logs ) {
        $self->_log( trace => '_parse_options::getopt: %s', \@getopt_args );
    }

    Getopt::Long::GetOptionsFromArray(

t/00-report-prereqs.dd  view on Meta::CPAN

                      'requires' => {
                                      'Capture::Tiny' => '0',
                                      'Carp' => '0',
                                      'Data::Dumper' => '0',
                                      'DateTime' => '0',
                                      'DateTime::Format::Strptime' => '0',
                                      'Getopt::Long' => '0',
                                      'IPC::Cmd' => '0',
                                      'IPC::Open3' => '0',
                                      'Moo' => '0',
                                      'Ref::Util' => '0',
                                      'Time::HiRes' => '0',
                                      'Types::Standard' => '0',
                                      'perl' => '5.010',
                                      'strict' => '0',
                                      'warnings' => '0'
                                    }
                    },
       'test' => {
                   'recommends' => {
                                     'CPAN::Meta' => '2.120900'



( run in 0.273 second using v1.01-cache-2.11-cpan-4d50c553e7e )