Example usage for org.apache.hadoop.mapred JobConf DEFAULT_MAPRED_TASK_JAVA_OPTS

List of usage examples for org.apache.hadoop.mapred JobConf DEFAULT_MAPRED_TASK_JAVA_OPTS

Introduction

In this page you can find the example usage for org.apache.hadoop.mapred JobConf DEFAULT_MAPRED_TASK_JAVA_OPTS.

Prototype

String DEFAULT_MAPRED_TASK_JAVA_OPTS

To view the source code for org.apache.hadoop.mapred JobConf DEFAULT_MAPRED_TASK_JAVA_OPTS.

Click Source Link

Usage

From source file:org.apache.tez.mapreduce.hadoop.MRHelpers.java

License:Apache License

/**
 * Generate JVM options based on MapReduce mapper java options. </p>
 *
 * This is only meant to be used if frameworks are not setting up their own java options,
 * and would like to fallback to using java options which may already be configured for
 * Hadoop MapReduce mappers.// w  ww .  jav a2 s  .c  o m
 *
 * Uses mapreduce.admin.map.child.java.opts, mapreduce.map.java.opts and
 * mapreduce.map.log.level from config to generate the opts.
 *
 * @param conf Configuration to be used to extract JVM opts specific info
 * @return JAVA_OPTS string to be used in launching the JVM
 */
@SuppressWarnings("deprecation")
public static String getJavaOptsForMRMapper(Configuration conf) {
    String adminOpts = conf.get(MRJobConfig.MAPRED_MAP_ADMIN_JAVA_OPTS,
            MRJobConfig.DEFAULT_MAPRED_ADMIN_JAVA_OPTS);

    String userOpts = conf.get(MRJobConfig.MAP_JAVA_OPTS,
            conf.get(JobConf.MAPRED_TASK_JAVA_OPTS, JobConf.DEFAULT_MAPRED_TASK_JAVA_OPTS));

    return adminOpts.trim() + " " + userOpts.trim() + " " + getLog4jCmdLineProperties(conf, true);
}

From source file:org.apache.tez.mapreduce.hadoop.MRHelpers.java

License:Apache License

/**
 * Generate JVM options based on MapReduce reducer java options. </p>
 *
 * This is only meant to be used if frameworks are not setting up their own java options,
 * and would like to fallback to using java options which may already be configured for
 * Hadoop MapReduce reducers./*www. j ava 2s.c  o m*/
 *
 * Uses mapreduce.admin.reduce.child.java.opts, mapreduce.reduce.java.opts
 * and mapreduce.reduce.log.level from config to generate the opts.
 *
 * @param conf Configuration to be used to extract JVM opts specific info
 * @return JAVA_OPTS string to be used in launching the JVM
 */
@SuppressWarnings("deprecation")
public static String getJavaOptsForMRReducer(Configuration conf) {
    String adminOpts = conf.get(MRJobConfig.MAPRED_REDUCE_ADMIN_JAVA_OPTS,
            MRJobConfig.DEFAULT_MAPRED_ADMIN_JAVA_OPTS);

    String userOpts = conf.get(MRJobConfig.REDUCE_JAVA_OPTS,
            conf.get(JobConf.MAPRED_TASK_JAVA_OPTS, JobConf.DEFAULT_MAPRED_TASK_JAVA_OPTS));

    return adminOpts.trim() + " " + userOpts.trim() + " " + getLog4jCmdLineProperties(conf, false);
}