aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorHari Shreedharan <hshreedharan@apache.org>2015-06-03 15:11:02 -0700
committerAndrew Or <andrew@databricks.com>2015-06-03 15:11:02 -0700
commita8f1f1543e29fb2897e9ae6940581b9e4a3a13fb (patch)
tree1b45b9cad47d6c9b1800510b73c7b8c4b6a720b2 /core
parentf27134782ebb61c360330e2d6d5bb1aa02be3fb6 (diff)
downloadspark-a8f1f1543e29fb2897e9ae6940581b9e4a3a13fb.tar.gz
spark-a8f1f1543e29fb2897e9ae6940581b9e4a3a13fb.tar.bz2
spark-a8f1f1543e29fb2897e9ae6940581b9e4a3a13fb.zip
[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.
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala b/core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala
index 52b149b273..5427a88f32 100644
--- a/core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala
+++ b/core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala
@@ -255,12 +255,12 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)
// If this is a legacy directory, then add the directory to the zipStream and add
// each file to that directory.
if (isLegacyLogDirectory(fs.getFileStatus(logPath))) {
- val files = fs.listFiles(logPath, false)
+ val files = fs.listStatus(logPath)
zipStream.putNextEntry(new ZipEntry(attempt.logPath + "/"))
zipStream.closeEntry()
- while (files.hasNext) {
- val file = files.next().getPath
- zipFileToStream(file, attempt.logPath + Path.SEPARATOR + file.getName, zipStream)
+ files.foreach { file =>
+ val path = file.getPath
+ zipFileToStream(path, attempt.logPath + Path.SEPARATOR + path.getName, zipStream)
}
} else {
zipFileToStream(new Path(logDir, attempt.logPath), attempt.logPath, zipStream)