MAPREDUCE-6676. NNBench should Throw IOException when rename and delete fails. Contributed by Brahma Reddy Battula.
This commit is contained in:
parent
0887355d9c
commit
bea02d229c
|
@ -868,7 +868,10 @@ public class NNBench extends Configured implements Tool {
|
||||||
try {
|
try {
|
||||||
// Set up timer for measuring AL
|
// Set up timer for measuring AL
|
||||||
startTimeAL = System.currentTimeMillis();
|
startTimeAL = System.currentTimeMillis();
|
||||||
filesystem.rename(filePath, filePathR);
|
boolean result = filesystem.rename(filePath, filePathR);
|
||||||
|
if (!result) {
|
||||||
|
throw new IOException("rename failed for " + filePath);
|
||||||
|
}
|
||||||
totalTimeAL1 += (System.currentTimeMillis() - startTimeAL);
|
totalTimeAL1 += (System.currentTimeMillis() - startTimeAL);
|
||||||
|
|
||||||
successfulOp = true;
|
successfulOp = true;
|
||||||
|
@ -901,7 +904,10 @@ public class NNBench extends Configured implements Tool {
|
||||||
try {
|
try {
|
||||||
// Set up timer for measuring AL
|
// Set up timer for measuring AL
|
||||||
startTimeAL = System.currentTimeMillis();
|
startTimeAL = System.currentTimeMillis();
|
||||||
filesystem.delete(filePath, true);
|
boolean result = filesystem.delete(filePath, true);
|
||||||
|
if (!result) {
|
||||||
|
throw new IOException("delete failed for " + filePath);
|
||||||
|
}
|
||||||
totalTimeAL1 += (System.currentTimeMillis() - startTimeAL);
|
totalTimeAL1 += (System.currentTimeMillis() - startTimeAL);
|
||||||
|
|
||||||
successfulOp = true;
|
successfulOp = true;
|
||||||
|
|
Loading…
Reference in New Issue