@InterfaceAudience.Public @InterfaceStability.Evolving public class MRHelpers extends Object
| Constructor and Description |
|---|
MRHelpers() |
| Modifier and Type | Method and Description |
|---|---|
static void |
configureMRApiUsage(org.apache.hadoop.conf.Configuration conf)
Update the provided configuration to use the new API (mapreduce) or the old API (mapred) based
on the configured InputFormat, OutputFormat, Partitioner etc.
|
static String |
getJavaOptsForMRAM(org.apache.hadoop.conf.Configuration conf)
Generate JVM options based on MapReduce AM java options.
|
static String |
getJavaOptsForMRMapper(org.apache.hadoop.conf.Configuration conf)
Generate JVM options based on MapReduce mapper java options.
|
static String |
getJavaOptsForMRReducer(org.apache.hadoop.conf.Configuration conf)
Generate JVM options based on MapReduce reducer java options.
|
static org.apache.hadoop.yarn.api.records.Resource |
getResourceForMRMapper(org.apache.hadoop.conf.Configuration conf)
Extract the container resource requirements from the provided configuration, which would
otherwise have been used when running a Hadoop MapReduce mapper.
|
static org.apache.hadoop.yarn.api.records.Resource |
getResourceForMRReducer(org.apache.hadoop.conf.Configuration conf)
Extract the container resource requirements from the provided configuration, which would
otherwise have been used when running a Hadoop MapReduce reducer.
|
static void |
translateMRConfToTez(org.apache.hadoop.conf.Configuration conf)
Translate MapReduce configuration keys to the equivalent Tez keys in the provided
configuration.
|
static void |
translateMRConfToTez(org.apache.hadoop.conf.Configuration conf,
boolean preferTez)
Translate MapReduce configuration keys to the equivalent Tez keys in the provided
configuration.
|
static void |
updateEnvBasedOnMRAMEnv(org.apache.hadoop.conf.Configuration conf,
Map<String,String> environment)
Setup environment variables based on the configured values for the MR AM
|
static void |
updateEnvBasedOnMRTaskEnv(org.apache.hadoop.conf.Configuration conf,
Map<String,String> environment,
boolean isMap)
Setup classpath and other environment variables based on the configured values for MR Mappers
or Reducers
|
public static void translateMRConfToTez(org.apache.hadoop.conf.Configuration conf)
conf - mr based configuration to be translated to tezpublic static void translateMRConfToTez(org.apache.hadoop.conf.Configuration conf,
boolean preferTez)
conf - mr based configuration to be translated to tezpreferTez - If the tez setting already exists and is set, use the Tez settingpublic static void configureMRApiUsage(org.apache.hadoop.conf.Configuration conf)
public static String getJavaOptsForMRAM(org.apache.hadoop.conf.Configuration conf)
conf - Configuration to be used to extract JVM opts specific infopublic static String getJavaOptsForMRMapper(org.apache.hadoop.conf.Configuration conf)
conf - Configuration to be used to extract JVM opts specific infopublic static String getJavaOptsForMRReducer(org.apache.hadoop.conf.Configuration conf)
conf - Configuration to be used to extract JVM opts specific infopublic static org.apache.hadoop.yarn.api.records.Resource getResourceForMRMapper(org.apache.hadoop.conf.Configuration conf)
Resource and would like to fallback to using resources
which may already be configured for Hadoop MapReduce mappers.conf - Configuration with MR specific settings used to extract
information frompublic static org.apache.hadoop.yarn.api.records.Resource getResourceForMRReducer(org.apache.hadoop.conf.Configuration conf)
Resource and would like to fallback to using resources
which may already be configured for Hadoop MapReduce reducers.
Uses mapreduce.reduce.memory.mb and mapreduce.reduce.cpu.vcores from the
provided configuration.conf - Configuration with MR specific settings used to extract
information frompublic static void updateEnvBasedOnMRTaskEnv(org.apache.hadoop.conf.Configuration conf,
Map<String,String> environment,
boolean isMap)
conf - Configuration to retrieve settings fromenvironment - Environment to updateisMap - Whether task is a map or reduce taskpublic static void updateEnvBasedOnMRAMEnv(org.apache.hadoop.conf.Configuration conf,
Map<String,String> environment)
conf - Configuration from which to extract informationenvironment - Environment map to updateCopyright © 2017 Apache Software Foundation. All rights reserved.