Merge -r 1213970:1213971 from trunk to branch-0.23. Fixes: MAPREDUCE-3542.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1215360 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5fe01ec75a
commit
8a58fd5440
|
@ -233,7 +233,10 @@ Release 0.23.1 - Unreleased
|
||||||
-showacls (Jonathan Eagles via mahadev)
|
-showacls (Jonathan Eagles via mahadev)
|
||||||
|
|
||||||
MAPREDUCE-3537. Fix race condition in DefaultContainerExecutor which led
|
MAPREDUCE-3537. Fix race condition in DefaultContainerExecutor which led
|
||||||
to container localization occuring in wrong directories. (acmurthy)
|
to container localization occuring in wrong directories. (acmurthy)
|
||||||
|
|
||||||
|
MAPREDUCE-3542. Support "FileSystemCounter" legacy counter group name for
|
||||||
|
compatibility. (tomwhite)
|
||||||
|
|
||||||
MAPREDUCE-3426. Fixed MR AM in uber mode to write map intermediate outputs
|
MAPREDUCE-3426. Fixed MR AM in uber mode to write map intermediate outputs
|
||||||
in the correct directory to work properly in secure mode. (Hitesh Shah via
|
in the correct directory to work properly in secure mode. (Hitesh Shah via
|
||||||
|
|
|
@ -76,6 +76,7 @@ public abstract class AbstractCounters<C extends Counter,
|
||||||
TaskCounter.class.getName());
|
TaskCounter.class.getName());
|
||||||
legacyMap.put("org.apache.hadoop.mapred.JobInProgress$Counter",
|
legacyMap.put("org.apache.hadoop.mapred.JobInProgress$Counter",
|
||||||
JobCounter.class.getName());
|
JobCounter.class.getName());
|
||||||
|
legacyMap.put("FileSystemCounter", FileSystemCounter.class.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
private final Limits limits = new Limits();
|
private final Limits limits = new Limits();
|
||||||
|
|
|
@ -22,6 +22,8 @@ import static org.junit.Assert.assertEquals;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
|
|
||||||
|
import org.apache.hadoop.mapred.Counters.Counter;
|
||||||
|
import org.apache.hadoop.mapreduce.FileSystemCounter;
|
||||||
import org.apache.hadoop.mapreduce.JobCounter;
|
import org.apache.hadoop.mapreduce.JobCounter;
|
||||||
import org.apache.hadoop.mapreduce.TaskCounter;
|
import org.apache.hadoop.mapreduce.TaskCounter;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -102,6 +104,7 @@ public class TestCounters {
|
||||||
Counters counters = new Counters();
|
Counters counters = new Counters();
|
||||||
counters.incrCounter(TaskCounter.MAP_INPUT_RECORDS, 1);
|
counters.incrCounter(TaskCounter.MAP_INPUT_RECORDS, 1);
|
||||||
counters.incrCounter(JobCounter.DATA_LOCAL_MAPS, 1);
|
counters.incrCounter(JobCounter.DATA_LOCAL_MAPS, 1);
|
||||||
|
counters.findCounter("file", FileSystemCounter.BYTES_READ).increment(1);
|
||||||
|
|
||||||
assertEquals("New name", 1, counters.findCounter(
|
assertEquals("New name", 1, counters.findCounter(
|
||||||
TaskCounter.class.getName(), "MAP_INPUT_RECORDS").getValue());
|
TaskCounter.class.getName(), "MAP_INPUT_RECORDS").getValue());
|
||||||
|
@ -114,6 +117,14 @@ public class TestCounters {
|
||||||
assertEquals("Legacy name", 1, counters.findCounter(
|
assertEquals("Legacy name", 1, counters.findCounter(
|
||||||
"org.apache.hadoop.mapred.JobInProgress$Counter",
|
"org.apache.hadoop.mapred.JobInProgress$Counter",
|
||||||
"DATA_LOCAL_MAPS").getValue());
|
"DATA_LOCAL_MAPS").getValue());
|
||||||
|
|
||||||
|
assertEquals("New name", 1, counters.findCounter(
|
||||||
|
FileSystemCounter.class.getName(), "FILE_BYTES_READ").getValue());
|
||||||
|
assertEquals("New name and method", 1, counters.findCounter("file",
|
||||||
|
FileSystemCounter.BYTES_READ).getValue());
|
||||||
|
assertEquals("Legacy name", 1, counters.findCounter(
|
||||||
|
"FileSystemCounter",
|
||||||
|
"FILE_BYTES_READ").getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException {
|
public static void main(String[] args) throws IOException {
|
||||||
|
|
Loading…
Reference in New Issue