Updated on 2022-09-14 GMT+08:00

Suggestions

Specify Global Configuration Items in mapred-site.xml

The following provides the configuration items of APIs in the mapred-site.xml file.

setMapperClass(Class <extends Mapper> cls) -> "mapreduce.job.map.class"

setReducerClass(Class<extends Reducer> cls) -> "mapreduce.job.reduce.class"

setCombinerClass(Class<extends Reducer> cls) -> "mapreduce.job.combine.class"

setInputFormatClass(Class<extends InputFormat> cls) -> "mapreduce.job.inputformat.class"

setJar(String jar) -> "mapreduce.job.jar"

setOutputFormat(Class< extends OutputFormat> theClass) -> "mapred.output.format.class"

setOutputKeyClass(Class<> theClass) -> "mapreduce.job.output.key.class"

setOutputValueClass(Class<> theClass) -> "mapreduce.job.output.value.class"

setPartitionerClass(Class<extends Partitioner> theClass) -> "mapred.partitioner.class"

setMapOutputCompressorClass(Class<extends CompressionCodec> codecClass)

-> "mapreduce.map.output.compress" & "mapreduce.map.output.compress.codec"

setJobPriority(JobPriority prio) -> "mapreduce.job.priority"

setQueueName(String queueName) -> "mapreduce.job.queuename"

setNumMapTasks(int n) -> "mapreduce.job.maps"

setNumReduceTasks(int n) -> "mapreduce.job.reduces"