hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [08/50] hadoop git commit: YARN-6517. Fix warnings from Spotbugs in hadoop-yarn-common(addendum). Contributed by Weiwei Yang.
Date Mon, 26 Jun 2017 12:49:42 GMT
YARN-6517. Fix warnings from Spotbugs in hadoop-yarn-common(addendum). Contributed by Weiwei
Yang.


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

Branch: refs/heads/HADOOP-13345
Commit: 7582dedad1c73eabdc3eeece0a3a860e7bb33c1a
Parents: 6460df2
Author: Naganarasimha <naganarasimha_gr@apache.org>
Authored: Sun Jun 18 19:53:42 2017 +0530
Committer: Naganarasimha <naganarasimha_gr@apache.org>
Committed: Sun Jun 18 19:53:42 2017 +0530

----------------------------------------------------------------------
 .../hadoop/yarn/logaggregation/AggregatedLogFormat.java  | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/7582deda/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/AggregatedLogFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/AggregatedLogFormat.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/AggregatedLogFormat.java
index e5cb255..d806b12 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/AggregatedLogFormat.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/AggregatedLogFormat.java
@@ -310,12 +310,17 @@ public class AggregatedLogFormat {
     }
 
     private Set<File> getPendingLogFilesToUpload(File containerLogDir) {
-      if(containerLogDir == null ||
-          containerLogDir.listFiles() == null) {
+      if(containerLogDir == null) {
         return new HashSet<>(0);
       }
+
+      File[] filesList = containerLogDir.listFiles();
+      if (filesList == null) {
+        return new HashSet<>(0);
+      }
+
       Set<File> candidates =
-          new HashSet<File>(Arrays.asList(containerLogDir.listFiles()));
+          new HashSet<File>(Arrays.asList(filesList));
       for (File logFile : candidates) {
         this.allExistingFileMeta.add(getLogFileMetaData(logFile));
       }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message