public class CompatibilityUtil extends Object
| Constructor and Description |
|---|
CompatibilityUtil() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.hadoop.conf.Configuration |
getConfiguration(org.apache.hadoop.mapreduce.JobContext context)
Invokes getConfiguration() on JobContext.
|
static org.apache.hadoop.mapreduce.Counter |
getCounter(org.apache.hadoop.mapreduce.TaskInputOutputContext context,
Enum<?> counter)
Invoke getCounter() on TaskInputOutputContext.
|
static long |
getCounterValue(org.apache.hadoop.mapreduce.Counter counter)
Hadoop 1 and 2 compatible counter.getValue()
|
static void |
incrementCounter(org.apache.hadoop.mapreduce.Counter counter,
long increment)
Increment the counter.
|
static boolean |
isVersion2x()
Returns true whether the runtime hadoop version is 2.x, false otherwise.
|
static org.apache.hadoop.mapreduce.TaskAttemptContext |
newTaskAttemptContext(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.mapreduce.TaskAttemptID id)
Creates TaskAttempContext from a JobConf and jobId using the correct
constructor for based on the hadoop version.
|
public static boolean isVersion2x()
public static org.apache.hadoop.mapreduce.TaskAttemptContext newTaskAttemptContext(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.mapreduce.TaskAttemptID id)
conf - Configurationid - TaskAttemptIDTaskAttemptContextpublic static org.apache.hadoop.conf.Configuration getConfiguration(org.apache.hadoop.mapreduce.JobContext context)
context - JobContextConfigurationpublic static org.apache.hadoop.mapreduce.Counter getCounter(org.apache.hadoop.mapreduce.TaskInputOutputContext context,
Enum<?> counter)
context - TaskInputOutputContextcounter - Mapreduce counterCounterpublic static void incrementCounter(org.apache.hadoop.mapreduce.Counter counter,
long increment)
counter - Counterincrement - Increment this counter by the given valuepublic static long getCounterValue(org.apache.hadoop.mapreduce.Counter counter)
counter - CounterCounter.getValue()Copyright © 2016. All Rights Reserved.