You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ju...@apache.org on 2017/09/14 05:12:56 UTC

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

Repository: hadoop
Updated Branches:
  refs/heads/trunk e0b3c644e -> c92c1d521


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/trunk
Commit: c92c1d521eadfd8a4cd8205cc6aee74816f353f4
Parents: e0b3c64
Author: Junping Du <ju...@apache.org>
Authored: Wed Sep 13 22:16:06 2017 -0700
Committer: Junping Du <ju...@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-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org