YARN-7194. Log aggregation status is always Failed with the newly added log aggregation IndexedFileFormat. Contributed by Xuan Gong.

This commit is contained in:
Junping Du 2017-09-13 22:16:06 -07:00
parent e0b3c644e1
commit c92c1d521e
2 changed files with 4 additions and 5 deletions

View File

@ -392,7 +392,8 @@ public class LogAggregationIndexedFileController
this.fsDataOStream.writeInt(length);
byte[] separator = this.uuid.getBytes(Charset.forName("UTF-8"));
this.fsDataOStream.write(separator);
if (logAggregationSuccessfullyInThisCyCle) {
if (logAggregationSuccessfullyInThisCyCle &&
record.isLogAggregationInRolling()) {
deleteFileWithRetries(fc, ugi, remoteLogCheckSumFile);
}
}

View File

@ -164,9 +164,7 @@ public class TestLogAggregationIndexFileController {
fileFormat.initializeWriter(context);
fileFormat.write(key1, value);
LogAggregationFileControllerContext record = mock(
LogAggregationFileControllerContext.class);
fileFormat.postWrite(record);
fileFormat.postWrite(context);
fileFormat.closeWriter();
ContainerLogsRequest logRequest = new ContainerLogsRequest();
@ -267,7 +265,7 @@ public class TestLogAggregationIndexFileController {
// first write and second write
fileFormat.initializeWriter(context);
fileFormat.write(key1, value2);
fileFormat.postWrite(record);
fileFormat.postWrite(context);
fileFormat.closeWriter();
fileFormat.readAggregatedLogsMeta(
logRequest);