App-Oozie
view release on metacpan or search on metacpan
lib/App/Oozie/Compare/LocalToHDFS.pm view on Meta::CPAN
package App::Oozie::Compare::LocalToHDFS;
use 5.014;
use strict;
use warnings;
our $VERSION = '0.020'; # VERSION
use namespace::autoclean -except => [qw/_options_data _options_config/];
use App::Oozie::Types::Common qw( IsDir );
use App::Oozie::Constants qw( HDFS_COMPARE_SKIP_FILES );
use Moo;
use MooX::Options prefer_commandline => 0,
protect_argv => 0,
usage_string => <<'USAGE',
Usage: %c %o
Compare the local oozie code path to the deployed HDFS path
USAGE
;
use File::Find ();
use File::Spec::Functions qw( catfile catdir );
use Scalar::Util qw( blessed );
use Types::Standard qw( Str );
with qw(
App::Oozie::Role::Fields::Common
App::Oozie::Role::Log
);
option local_path => (
is => 'rw',
format => 's',
required => 1,
isa => IsDir,
doc => 'Local path',
);
option hdfs_path => (
is => 'rw',
isa => Str,
format => 's',
required => 1,
doc => 'HDFS path',
);
option delete => (
is => 'rw',
doc => 'Cleanup HDFS based on findings?',
);
sub BUILD {
my ($self, $args) = @_;
my $hdfs = $self->hdfs;
my $hdfs_path = $self->hdfs_path;
my $stat = $hdfs->exists( $hdfs_path )
|| die "$hdfs_path does not exist on HDFS";
if ( $stat->{type} ne 'DIRECTORY' ) {
die "$hdfs_path exists but it is not a directory";
}
return;
}
( run in 0.497 second using v1.01-cache-2.11-cpan-56fb94df46f )