Skip to content

Commit a8f1f15

Browse files
harishreedharanAndrew Or
authored and
Andrew Or
committed
[HOTFIX] Fix Hadoop-1 build caused by #5792.
Replaced `fs.listFiles` with Hadoop-1 friendly `fs.listStatus` method. Author: Hari Shreedharan <hshreedharan@apache.org> Closes #6619 from harishreedharan/evetlog-hadoop-1-fix and squashes the following commits: 6192078 [Hari Shreedharan] [HOTFIX] Fix Hadoop-1 build caused by #5972.
1 parent f271347 commit a8f1f15

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,12 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)
255255
// If this is a legacy directory, then add the directory to the zipStream and add
256256
// each file to that directory.
257257
if (isLegacyLogDirectory(fs.getFileStatus(logPath))) {
258-
val files = fs.listFiles(logPath, false)
258+
val files = fs.listStatus(logPath)
259259
zipStream.putNextEntry(new ZipEntry(attempt.logPath + "/"))
260260
zipStream.closeEntry()
261-
while (files.hasNext) {
262-
val file = files.next().getPath
263-
zipFileToStream(file, attempt.logPath + Path.SEPARATOR + file.getName, zipStream)
261+
files.foreach { file =>
262+
val path = file.getPath
263+
zipFileToStream(path, attempt.logPath + Path.SEPARATOR + path.getName, zipStream)
264264
}
265265
} else {
266266
zipFileToStream(new Path(logDir, attempt.logPath), attempt.logPath, zipStream)

0 commit comments

Comments
 (0)