YARN-7194. Log aggregation status is always Failed with the newly added log aggregation IndexedFileFormat. Contributed by Xuan Gong.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/c92c1d52 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/c92c1d52 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/c92c1d52 Branch: refs/heads/YARN-1011 Commit: c92c1d521eadfd8a4cd8205cc6aee74816f353f4 Parents: e0b3c64 Author: Junping Du <junping...@apache.org> Authored: Wed Sep 13 22:16:06 2017 -0700 Committer: Junping Du <junping...@apache.org> Committed: Wed Sep 13 22:16:06 2017 -0700 ---------------------------------------------------------------------- .../ifile/LogAggregationIndexedFileController.java | 3 ++- .../ifile/TestLogAggregationIndexFileController.java | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/c92c1d52/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/LogAggregationIndexedFileController.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/LogAggregationIndexedFileController.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/LogAggregationIndexedFileController.java index 6cb2062..243945e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/LogAggregationIndexedFileController.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/LogAggregationIndexedFileController.java @@ -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); } } http://git-wip-us.apache.org/repos/asf/hadoop/blob/c92c1d52/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/TestLogAggregationIndexFileController.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/TestLogAggregationIndexFileController.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/TestLogAggregationIndexFileController.java index 5f61710..f77ad96 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/TestLogAggregationIndexFileController.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/TestLogAggregationIndexFileController.java @@ -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); --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org