true, the bootstrap action executes.
* @param array $args (Optional) An indexed array of arguments to pass to the script.
* @return array A configuration set to be provided when running a job flow.
*/
public static function run_if($condition, $args = null)
{
if (!$args) $args = array();
$args = is_array($args) ? $args : array($args);
return self::script_runner('s3://us-east-1.elasticmapreduce/bootstrap-actions/run-if', $args);
}
/**
* Specify options to merge with Hadoop's default configuration.
*
* @param string $file (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
]
* @param string|array $config (Required) This can either be an XML file in S3 (as s3://bucket/path
), or an associative array of key-value pairs.
* @return array A configuration set to be provided when running a job flow.
*/
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://us-east-1.elasticmapreduce/bootstrap-actions/configure-hadoop', $args);
}
/**
* Create a new bootstrap action which lets you configure Hadoop's daemons. The options are written to
* the hadoop-user-env.sh
file.
*
* @param string $daemon_type (Required) The Hadoop daemon to configure.
* @param array $opt (Optional) An associative array of parameters that can have the following keys:
HeapSize
- integer
- Optional - The requested heap size of the daemon, in megabytes.CLIOptions
- string
- Optional - Additional Java command line arguments to pass to the daemon.Replace
- boolean
- Optional - Whether or not the file should be replaced. A value of true
will replace the existing configuration file. A value of false
will append the options to the configuration file.