App-Oozie

 view release on metacpan or  search on metacpan

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

package App::Oozie::Run;

use 5.014;
use strict;
use warnings;

our $VERSION = '0.016'; # VERSION

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

use App::Oozie::Constants qw(
    DEFAULT_END_DATE_DAYS
    DEFAULT_START_DATE_DAY_FRAME
    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;
use File::Spec;
use File::Temp ();
use IO::Interactive qw( is_interactive );
use IPC::Cmd        ();
use Ref::Util       qw( is_ref is_hashref is_arrayref );
use Template;
use Time::Duration  qw( duration_exact );
use Types::Standard qw( Int );
use XML::LibXML::Simple;

use Moo;
use MooX::Options prefer_commandline => 0,
                  protect_argv       => 0,
                  usage_string       => <<'USAGE',
Usage: %c %o [options] workflow-name
USAGE
;

with qw(
    App::Oozie::Role::Log
    App::Oozie::Role::Fields::Common
    App::Oozie::Role::Fields::Path
    App::Oozie::Role::Meta
    App::Oozie::Role::Info
);

#------------------------------------------------------------------------------#

option appname => (
    is     => 'rw',
    format => 's',
    doc    => remove_newline( <<'DOC' ),
Workflow name, useful if you want to run different instances of the same
workflow with different parameters. If not set, then this will default to
the workflow basename.
DOC
);

my $__JOB_TYPES = eval {
    sprintf ' Valid values are %s',
            join q{, },
            @{ IsJobType->parent->values },
    ;
} || EMPTY_STRING;

option type => (
    default => sub { 'coord' },
    is      => 'rw',
    isa     => IsJobType,
    format  => 's',
    doc     => remove_newline( sprintf <<'DOC', $__JOB_TYPES ),
Defines the type of job the user needs to launch. If nothing is specified,
the script will check the existence of a coordinator.xml file, to determine
whether this should be launched as a coordinator or a single workflow.%s
DOC
);

option notify => (
    is      => 'rw',
    default => sub { 1 },
);

option define => (
    is      => 'rw',
    format  => 's@',

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.539 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )