YARN-6517. Fix warnings from Spotbugs in hadoop-yarn-common(addendum). Contributed by Weiwei Yang.
This commit is contained in:
parent
6460df21a0
commit
7582dedad1
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue