configure ( $file, $config )

Specify options to merge with Hadoop’s default configuration.

Access

public static

Parameters

Parameter

Type

Required

Description

$file

string

Required

The Hadoop configuration file to merge with. [Allowed values: CFHadoopBootstrap::CONFIG_SITE, CFHadoopBootstrap::CONFIG_DEFAULT, CFHadoopBootstrap::CONFIG_CORE, CFHadoopBootstrap::CONFIG_HDFS, CFHadoopBootstrap::CONFIG_MAPREDUCE]

$config

string
array

Required

This can either be an XML file in S3 (as s3://bucket/path), or an associative array of key-value pairs.

Returns

Type

Description

array

A configuration set to be provided when running a job flow.

Source

Method defined in utilities/hadoopbootstrap.class.php | Toggle source view (21 lines) | View on GitHub

public static function configure($file, $config)
{
    $args = array();
    $file_arg = '-' . $file;

    if (is_string($config))
    {
        $args[] = $file_arg;
        $args[] = $config;
    }
    elseif (is_array($config))
    {
        foreach ($config as $key => $value)
        {
            $args[] = $file_arg;
            $args[] = $key . '=' . $value;
        }
    }

        return self::script_runner('s3://' . self::$region . '.elasticmapreduce/bootstrap-actions/configure-hadoop', $args);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback