Repository: hadoop
Updated Branches:
  refs/heads/branch-2 f525dfc5e -> 7e6cc1713


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

(cherry picked from commit c92c1d521eadfd8a4cd8205cc6aee74816f353f4)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/7e6cc171
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/7e6cc171
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/7e6cc171

Branch: refs/heads/branch-2
Commit: 7e6cc17133dc2b87f1a9ed8fec3f156267095f7d
Parents: f525dfc
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:18:39 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/7e6cc171/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/7e6cc171/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

Reply via email to