MAPREDUCE-6363. [NNBench] Lease mismatch error when running with multiple mappers. Contributed by Brahma Reddy Battula.
(cherry picked from commit 75a2560e51
)
This commit is contained in:
parent
069acdac8a
commit
98446ee695
|
@ -213,6 +213,9 @@ Release 2.8.0 - UNRELEASED
|
||||||
MAPREDUCE-6389. Fix BaileyBorweinPlouffe CLI usage message. (Brahma Reddy Battula
|
MAPREDUCE-6389. Fix BaileyBorweinPlouffe CLI usage message. (Brahma Reddy Battula
|
||||||
via devaraj)
|
via devaraj)
|
||||||
|
|
||||||
|
MAPREDUCE-6363. [NNBench] Lease mismatch error when running with multiple
|
||||||
|
mappers. (Brahma Reddy Battula via aajisaka)
|
||||||
|
|
||||||
Release 2.7.1 - UNRELEASED
|
Release 2.7.1 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -57,6 +57,9 @@ import org.apache.hadoop.mapred.Reporter;
|
||||||
import org.apache.hadoop.mapred.OutputCollector;
|
import org.apache.hadoop.mapred.OutputCollector;
|
||||||
import org.apache.hadoop.mapred.JobConf;
|
import org.apache.hadoop.mapred.JobConf;
|
||||||
import org.apache.hadoop.mapred.Reducer;
|
import org.apache.hadoop.mapred.Reducer;
|
||||||
|
import org.apache.hadoop.mapreduce.MRJobConfig;
|
||||||
|
import org.apache.hadoop.mapreduce.TaskAttemptID;
|
||||||
|
import org.apache.hadoop.mapreduce.v2.api.records.TaskId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This program executes a specified operation that applies load to
|
* This program executes a specified operation that applies load to
|
||||||
|
@ -687,6 +690,9 @@ public class NNBench {
|
||||||
dataDirName = conf.get("test.nnbench.datadir.name");
|
dataDirName = conf.get("test.nnbench.datadir.name");
|
||||||
op = conf.get("test.nnbench.operation");
|
op = conf.get("test.nnbench.operation");
|
||||||
readFile = conf.getBoolean("test.nnbench.readFileAfterOpen", false);
|
readFile = conf.getBoolean("test.nnbench.readFileAfterOpen", false);
|
||||||
|
int taskId =
|
||||||
|
TaskAttemptID.forName(conf.get(MRJobConfig.TASK_ATTEMPT_ID))
|
||||||
|
.getTaskID().getId();
|
||||||
|
|
||||||
long totalTimeTPmS = 0l;
|
long totalTimeTPmS = 0l;
|
||||||
long startTimeTPmS = 0l;
|
long startTimeTPmS = 0l;
|
||||||
|
@ -699,18 +705,19 @@ public class NNBench {
|
||||||
successfulFileOps = 0l;
|
successfulFileOps = 0l;
|
||||||
|
|
||||||
if (barrier()) {
|
if (barrier()) {
|
||||||
|
String filePrefix = "file_" + taskId + "_";
|
||||||
if (op.equals(OP_CREATE_WRITE)) {
|
if (op.equals(OP_CREATE_WRITE)) {
|
||||||
startTimeTPmS = System.currentTimeMillis();
|
startTimeTPmS = System.currentTimeMillis();
|
||||||
doCreateWriteOp("file_" + hostName + "_", reporter);
|
doCreateWriteOp(filePrefix, reporter);
|
||||||
} else if (op.equals(OP_OPEN_READ)) {
|
} else if (op.equals(OP_OPEN_READ)) {
|
||||||
startTimeTPmS = System.currentTimeMillis();
|
startTimeTPmS = System.currentTimeMillis();
|
||||||
doOpenReadOp("file_" + hostName + "_", reporter);
|
doOpenReadOp(filePrefix, reporter);
|
||||||
} else if (op.equals(OP_RENAME)) {
|
} else if (op.equals(OP_RENAME)) {
|
||||||
startTimeTPmS = System.currentTimeMillis();
|
startTimeTPmS = System.currentTimeMillis();
|
||||||
doRenameOp("file_" + hostName + "_", reporter);
|
doRenameOp(filePrefix, reporter);
|
||||||
} else if (op.equals(OP_DELETE)) {
|
} else if (op.equals(OP_DELETE)) {
|
||||||
startTimeTPmS = System.currentTimeMillis();
|
startTimeTPmS = System.currentTimeMillis();
|
||||||
doDeleteOp("file_" + hostName + "_", reporter);
|
doDeleteOp(filePrefix, reporter);
|
||||||
}
|
}
|
||||||
|
|
||||||
endTimeTPms = System.currentTimeMillis();
|
endTimeTPms = System.currentTimeMillis();
|
||||||
|
|
Loading…
Reference in New Issue