aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorLiwei Lin <lwlin7@gmail.com>2016-04-20 11:28:51 +0100
committerSean Owen <sowen@cloudera.com>2016-04-20 11:28:51 +0100
commit17db4bfeaa0074298db622db38a5b0459518c4a9 (patch)
treed3f8b90be7a3ca83f3e01ad47ff50865a784060b /core
parenta3451119d951949f24f3a4c5e33a5daea615dfed (diff)
downloadspark-17db4bfeaa0074298db622db38a5b0459518c4a9.tar.gz
spark-17db4bfeaa0074298db622db38a5b0459518c4a9.tar.bz2
spark-17db4bfeaa0074298db622db38a5b0459518c4a9.zip
[SPARK-14687][CORE][SQL][MLLIB] Call path.getFileSystem(conf) instead of call FileSystem.get(conf)
## What changes were proposed in this pull request? - replaced `FileSystem.get(conf)` calls with `path.getFileSystem(conf)` ## How was this patch tested? N/A Author: Liwei Lin <lwlin7@gmail.com> Closes #12450 from lw-lin/fix-fs-get.
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala4
1 files changed, 2 insertions, 2 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 d5afb33c71..2bd4a46e16 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
@@ -353,7 +353,7 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)
* the name of the file being compressed.
*/
def zipFileToStream(file: Path, entryName: String, outputStream: ZipOutputStream): Unit = {
- val fs = FileSystem.get(hadoopConf)
+ val fs = file.getFileSystem(hadoopConf)
val inputStream = fs.open(file, 1 * 1024 * 1024) // 1MB Buffer
try {
outputStream.putNextEntry(new ZipEntry(entryName))
@@ -372,7 +372,7 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)
attempt.attemptId.isEmpty || attemptId.isEmpty || attempt.attemptId.get == attemptId.get
}.foreach { attempt =>
val logPath = new Path(logDir, attempt.logPath)
- zipFileToStream(new Path(logDir, attempt.logPath), attempt.logPath, zipStream)
+ zipFileToStream(logPath, attempt.logPath, zipStream)
}
} finally {
zipStream.close()