Puppet Class: cdh::pig

Defined in:
modules/cdh/manifests/pig.pp

Overview

Class cdh::pig

Installs and configures Apache Pig and Pig DataFu.

Parameters:

  • pig_properties_template (Any) (defaults to: 'cdh/pig/pig.properties.erb')
  • log4j_template (Any) (defaults to: 'cdh/pig/log4j.properties.erb')


5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'modules/cdh/manifests/pig.pp', line 5

class cdh::pig(
    $pig_properties_template = 'cdh/pig/pig.properties.erb',
    $log4j_template          = 'cdh/pig/log4j.properties.erb',
)
{
    # cdh::pig requires hadoop client and configs are installed.
    Class['cdh::hadoop'] -> Class['cdh::pig']

    package { 'pig':
        ensure => 'installed',
    }
    package { 'pig-udf-datafu':
        ensure => 'installed',
    }

    $config_directory = "/etc/pig/conf.${cdh::hadoop::cluster_name}"
    # Create the $cluster_name based $config_directory.
    file { $config_directory:
        ensure  => 'directory',
        require => Package['pig'],
    }
    cdh::alternative { 'pig-conf':
        link => '/etc/pig/conf',
        path => $config_directory,
    }

    file { "${config_directory}/pig.properties":
        content => template($pig_properties_template),
        require => Package['pig'],
    }
    file { "${config_directory}/log4j.properties":
        content => template($log4j_template),
        require => Package['pig'],
    }
}