App-Oozie

 view release on metacpan or  search on metacpan

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

package App::Oozie::Role::Fields::Common;

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( IsUserName );
use App::Oozie::Constants qw(
    DEFAULT_CLUSTER_NAME
    DEFAULT_HDFS_WF_PATH
);
use Moo::Role;
use MooX::Options;
use Types::Standard qw( Bool Str );

with qw(
    App::Oozie::Role::Fields::Generic
    App::Oozie::Role::Fields::Path
    App::Oozie::Role::Fields::Objects
);

option cluster_name => (
    is      => 'rw',
    isa     => Str,
    default => sub { DEFAULT_CLUSTER_NAME },
    format  => 's',
    doc     => 'The Hadoop cluster name',
);

option username => (
    is      => 'rw',
    isa     => IsUserName,
    short   => 'user',
    format  => 's',
    doc     => 'User name under which the job should be submitted. Not set by default and commands will be executed as the effective user',
);

has execute_as_someone_else => (
    is      => 'ro',
    isa     => Bool,
    default => sub {
        my $self = shift;
        my $deployment_user = $self->username;
        return $deployment_user
                && $deployment_user ne $self->effective_username ? 1 : 0;
    },
    lazy => 1,
);

option oozie_uri => (
    is      => 'ro',
    format  => 's',
    doc     => 'The address to the oozie instance',
    lazy    => 1,
    default => sub { shift->oozie->oozie_uri },
);

option default_hdfs_destination => (
    is      => 'rw',
    format  => 's',
    default => sub { DEFAULT_HDFS_WF_PATH },
    doc     => 'The HDFS destination for the compiled Oozie workflows',
);

option oozie_basepath => (



( run in 1.810 second using v1.01-cache-2.11-cpan-bbe5e583499 )