App-Oozie

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

lib/App/Oozie/Role/Info.pm
lib/App/Oozie/Role/Log.pm
lib/App/Oozie/Role/Meta.pm
lib/App/Oozie/Role/NameNode.pm
lib/App/Oozie/Role/Validate/XML.pm
lib/App/Oozie/Run.pm
lib/App/Oozie/Serializer.pm
lib/App/Oozie/Serializer/Dummy.pm
lib/App/Oozie/Serializer/YAML.pm
lib/App/Oozie/Types/Common.pm
lib/App/Oozie/Types/DateTime.pm
lib/App/Oozie/Types/States.pm
lib/App/Oozie/Types/Workflow.pm
lib/App/Oozie/Update/Coordinator.pm
lib/App/Oozie/Util/Log4perl.pm
lib/App/Oozie/Util/Log4perl/Templates/simple.l4p
lib/App/Oozie/Util/Misc.pm
lib/App/Oozie/Util/Plugin.pm
lib/App/Oozie/XML.pm
perlcritic.rc
t/00-compile.t

META.json  view on Meta::CPAN

            "Archive::Zip" : "0",
            "Carp" : "0",
            "Carp::Always" : "0",
            "Clone" : "0",
            "Config::General" : "0",
            "Config::Properties" : "0",
            "Cwd" : "0",
            "Data::Dumper" : "0",
            "Date::Format" : "0",
            "Date::Parse" : "0",
            "DateTime" : "0",
            "DateTime::Format::Duration" : "0",
            "DateTime::Format::Strptime" : "0",
            "Email::Valid" : "0",
            "Exporter" : "0",
            "Fcntl" : "0",
            "File::Basename" : "0",
            "File::Find" : "0",
            "File::Find::Rule" : "0",
            "File::Path" : "0",
            "File::Spec" : "0",
            "File::Spec::Functions" : "0",
            "File::Temp" : "0",

META.yml  view on Meta::CPAN

  Archive::Zip: '0'
  Carp: '0'
  Carp::Always: '0'
  Clone: '0'
  Config::General: '0'
  Config::Properties: '0'
  Cwd: '0'
  Data::Dumper: '0'
  Date::Format: '0'
  Date::Parse: '0'
  DateTime: '0'
  DateTime::Format::Duration: '0'
  DateTime::Format::Strptime: '0'
  Email::Valid: '0'
  Exporter: '0'
  Fcntl: '0'
  File::Basename: '0'
  File::Find: '0'
  File::Find::Rule: '0'
  File::Path: '0'
  File::Spec: '0'
  File::Spec::Functions: '0'
  File::Temp: '0'

Makefile.PL  view on Meta::CPAN

    "Archive::Zip" => 0,
    "Carp" => 0,
    "Carp::Always" => 0,
    "Clone" => 0,
    "Config::General" => 0,
    "Config::Properties" => 0,
    "Cwd" => 0,
    "Data::Dumper" => 0,
    "Date::Format" => 0,
    "Date::Parse" => 0,
    "DateTime" => 0,
    "DateTime::Format::Duration" => 0,
    "DateTime::Format::Strptime" => 0,
    "Email::Valid" => 0,
    "Exporter" => 0,
    "Fcntl" => 0,
    "File::Basename" => 0,
    "File::Find" => 0,
    "File::Find::Rule" => 0,
    "File::Path" => 0,
    "File::Spec" => 0,
    "File::Spec::Functions" => 0,
    "File::Temp" => 0,

Makefile.PL  view on Meta::CPAN

  "Archive::Zip" => 0,
  "Carp" => 0,
  "Carp::Always" => 0,
  "Clone" => 0,
  "Config::General" => 0,
  "Config::Properties" => 0,
  "Cwd" => 0,
  "Data::Dumper" => 0,
  "Date::Format" => 0,
  "Date::Parse" => 0,
  "DateTime" => 0,
  "DateTime::Format::Duration" => 0,
  "DateTime::Format::Strptime" => 0,
  "Email::Valid" => 0,
  "Exporter" => 0,
  "ExtUtils::MakeMaker" => 0,
  "Fcntl" => 0,
  "File::Basename" => 0,
  "File::Find" => 0,
  "File::Find::Rule" => 0,
  "File::Path" => 0,
  "File::Spec" => 0,
  "File::Spec::Functions" => 0,

lib/App/Oozie/Date.pm  view on Meta::CPAN


our $VERSION = '0.020'; # VERSION

use namespace::autoclean -except => [qw/_options_data _options_config/];

use App::Oozie::Constants qw(
    DATE_PATTERN
    SHORTCUT_METHODS
);
use Carp qw( croak );
use DateTime;
use DateTime::Format::Strptime;
use DateTime::Format::Duration;
use Moo;
use Types::Standard qw( Str );

has strp => (
    is      => 'ro',
    default => sub {
        my $self = shift;
        DateTime::Format::Strptime->new(
                pattern   => DATE_PATTERN,
                time_zone => $self->timezone,
                on_error  => 'croak',
            );
    },
    lazy => 1,
);

has strp_silent => (
    is      => 'ro',
    default => sub {
        my $self = shift;
        DateTime::Format::Strptime->new(
                pattern   => DATE_PATTERN,
                time_zone => $self->timezone,
            );
    },
    lazy => 1,
);

has timezone => (
    is       => 'rw',
    isa      => Str,
    required => 1,
);

sub today {
    my $self  = shift;
    return $self->_stringify_dt( DateTime->today );
}

sub tomorrow {
    my $self  = shift;
    my $today = DateTime->today;
    $today->add( days => 1 );
    return $self->_stringify_dt( $today );
}

sub yesterday {
    my $self  = shift;
    my $today = DateTime->today;
    $today->subtract( days => 1 );
    return $self->_stringify_dt( $today );
}

sub diff {
    my $self   = shift;
    my $date_1 = shift || croak 'First date is missing';
    my $date_2 = shift || croak 'Second date is missing';

    my $dt1 = $self->strp->parse_datetime( $date_1 );
    my $dt2 = $self->strp->parse_datetime( $date_2 );
    my $dur = $dt1->subtract_datetime( $dt2 );

    my $days = DateTime::Format::Duration
                ->new( pattern => '%j')
                ->format_duration( $dur );
    return $days;
}

sub is_valid {
    my $self = shift;
    my $date = shift || croak 'Date is missing';
    my $rv = $self->strp_silent->parse_datetime( $date );
    if ( ! $rv ) {

lib/App/Oozie/Date.pm  view on Meta::CPAN

    return if  $x_start_epoch > $x_end_epoch
            || $y_start_epoch > $y_end_epoch
            || $y_start_epoch > $x_end_epoch
            || $x_start_epoch > $y_end_epoch
    ;

    my $start = 0 < ($x_start_epoch <=> $y_start_epoch) ? $x_start_epoch : $y_start_epoch;
    my $end   = 0 > ($x_end_epoch   <=> $y_end_epoch  ) ? $x_end_epoch   : $y_end_epoch;

    return {
        start => $self->_stringify_dt( DateTime->from_epoch( epoch => $start ) ),
        end   => $self->_stringify_dt( DateTime->from_epoch( epoch => $end   ) ),
    };
}

sub epoch_yyyy_mm_dd_hh_mm_ss {
    my $self  = shift;
    my $epoch = shift || Carp::confess 'Epoch not specified!';
    my $strp  = DateTime::Format::Strptime->new(
                    pattern   => '%Y-%m-%d %H:%M:%S %Z',
                    time_zone => $self->timezone,
                    on_error  => 'croak',
                );
    return $strp->format_datetime(
                DateTime->from_epoch(
                    epoch     => $epoch,
                    time_zone => $self->timezone,
                )
            );
}

1;

__END__

lib/App/Oozie/Deploy.pm  view on Meta::CPAN


use App::Oozie::Deploy::Template;
use App::Oozie::Deploy::Validate::Spec;
use App::Oozie::Types::Common qw( IsDir IsFile );
use App::Oozie::Util::Misc qw( resolve_tmp_dir trim_slashes );
use App::Oozie::Constants qw( OOZIE_STATES_RUNNING );

use Carp ();
use Config::Properties;
use Config::General ();
use DateTime::Format::Strptime;
use DateTime;
use Email::Valid;
use Fcntl           qw( :mode );
use File::Basename  qw( basename dirname );
use File::Find ();
use File::Find::Rule;
use File::Spec;
use File::Temp ();
use List::MoreUtils qw( uniq );
use List::Util      qw( max  );
use Path::Tiny      qw( path );

lib/App/Oozie/Rerun.pm  view on Meta::CPAN


use namespace::autoclean -except => [qw/_options_data _options_config/];

use App::Oozie::Constants       qw(
    DEFAULT_OOZIE_MAX_JOBS
    EMPTY_STRING
    HOURS_IN_A_DAY
    ONE_HOUR
    RE_AT
);
use App::Oozie::Types::DateTime qw( IsDateStr );
use App::Oozie::Types::States   qw( IsOozieStateRerunnable );
use Date::Parse ();
use IPC::Cmd    ();
use Template;
use Types::Standard qw( ArrayRef Int Str );
use Moo;
use MooX::Options prefer_commandline => 0,
                  protect_argv       => 0,
                  usage_string       => <<'USAGE',
Usage: %c %o [options]

lib/App/Oozie/Role/Fields/Objects.pm  view on Meta::CPAN


our $VERSION = '0.020'; # VERSION

use namespace::autoclean -except => [qw/_options_data _options_config/];

use App::Oozie::Constants qw(
    DEFAULT_TZ
    DEFAULT_WEBHDFS_PORT
);
use App::Oozie::Date;
use App::Oozie::Types::DateTime qw( IsTZ );
use DateTime;
use Moo::Role;
use MooX::Options;
use Net::Hadoop::Oozie;
use Net::Hadoop::WebHDFS::LWP;
use Types::Standard qw( InstanceOf );

option resource_manager => (
    is     => 'rw',
    format => 's',
);

lib/App/Oozie/Run.pm  view on Meta::CPAN

    EMPTY_STRING
    FORMAT_ZULU_TIME
    INDEX_NOT_FOUND
    MAX_RETRY
    OOZIE_STATES_RUNNING
    SHORTCUT_METHODS
    SPACE_CHAR
    TERMINAL_LINE_LEN
);
use App::Oozie::Date;
use App::Oozie::Types::DateTime qw( IsDate IsHour IsMinute );
use App::Oozie::Types::Common qw( IsJobType );
use App::Oozie::Util::Misc qw(
    remove_newline
    resolve_tmp_dir
    trim_slashes
);

use Config::Properties;
use Cwd;
use File::Basename;

lib/App/Oozie/Types/DateTime.pm  view on Meta::CPAN

package App::Oozie::Types::DateTime;

use 5.014;
use strict;
use warnings;

our $VERSION = '0.020'; # VERSION

use App::Oozie::Date;
use App::Oozie::Constants qw(
    SHORTCUT_METHODS
);
use Date::Parse ();
use DateTime    ();

use Type::Library -base;
use Type::Tiny;
use Type::Utils -all;
use Sub::Quote qw( quote_sub );

BEGIN {
    extends 'Types::Standard';
}

lib/App/Oozie/Types/DateTime.pm  view on Meta::CPAN

        my $val = shift;
        return if ! $val;
        return Date::Parse::str2time $val;
    },
;

declare IsTZ => as Str,
    constraint => quote_sub q{
        my $val = shift || return;
        eval {
            DateTime->now( time_zone => $val );
            1;
        };
    },
;

1;

__END__

=pod

=encoding UTF-8

=head1 NAME

App::Oozie::Types::DateTime

=head1 VERSION

version 0.020

=head1 SYNOPSIS

    use  App::Oozie::Types::DateTime qw( IsDate );

=head1 DESCRIPTION

Internal types.

=head1 NAME

App::Oozie::Types::DateTime - Internal types.

=head1 Types

=head2 IsDate

=head2 IsDateStr

=head2 IsHour

=head2 IsMinute

t/00-compile.t  view on Meta::CPAN

    'App/Oozie/Role/Info.pm',
    'App/Oozie/Role/Log.pm',
    'App/Oozie/Role/Meta.pm',
    'App/Oozie/Role/NameNode.pm',
    'App/Oozie/Role/Validate/XML.pm',
    'App/Oozie/Run.pm',
    'App/Oozie/Serializer.pm',
    'App/Oozie/Serializer/Dummy.pm',
    'App/Oozie/Serializer/YAML.pm',
    'App/Oozie/Types/Common.pm',
    'App/Oozie/Types/DateTime.pm',
    'App/Oozie/Types/States.pm',
    'App/Oozie/Types/Workflow.pm',
    'App/Oozie/Update/Coordinator.pm',
    'App/Oozie/Util/Log4perl.pm',
    'App/Oozie/Util/Misc.pm',
    'App/Oozie/Util/Plugin.pm',
    'App/Oozie/XML.pm'
);

my @scripts = (

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

                                      'Archive::Zip' => '0',
                                      'Carp' => '0',
                                      'Carp::Always' => '0',
                                      'Clone' => '0',
                                      'Config::General' => '0',
                                      'Config::Properties' => '0',
                                      'Cwd' => '0',
                                      'Data::Dumper' => '0',
                                      'Date::Format' => '0',
                                      'Date::Parse' => '0',
                                      'DateTime' => '0',
                                      'DateTime::Format::Duration' => '0',
                                      'DateTime::Format::Strptime' => '0',
                                      'Email::Valid' => '0',
                                      'Exporter' => '0',
                                      'Fcntl' => '0',
                                      'File::Basename' => '0',
                                      'File::Find' => '0',
                                      'File::Find::Rule' => '0',
                                      'File::Path' => '0',
                                      'File::Spec' => '0',
                                      'File::Spec::Functions' => '0',
                                      'File::Temp' => '0',

t/use.t  view on Meta::CPAN

use App::Oozie::Role::Fields::Path;
use App::Oozie::Role::Git;
use App::Oozie::Role::Log;
use App::Oozie::Role::Meta;
use App::Oozie::Role::NameNode;
use App::Oozie::Run;
use App::Oozie::Serializer::Dummy;
use App::Oozie::Serializer::YAML;
use App::Oozie::Serializer;
use App::Oozie::Types::Common;
use App::Oozie::Types::DateTime;
use App::Oozie::Types::States;
use App::Oozie::Types::Workflow;
use App::Oozie::Update::Coordinator;
use App::Oozie::Util::Log4perl;
use App::Oozie::Util::Misc;
use App::Oozie::Util::Plugin;
use App::Oozie::XML;
use App::Oozie;

ok(1, 'Use ok');



( run in 0.385 second using v1.01-cache-2.11-cpan-496ff517765 )