Skip to content

Commit e2cd25c

Browse files
committed
Use Hadoop FileSystem API
1 parent 7eec0c1 commit e2cd25c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/FileStreamSinkLogSuite.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package org.apache.spark.sql.execution.streaming
1919

20-
import java.io.File
2120
import java.nio.charset.StandardCharsets.UTF_8
2221

2322
import org.apache.spark.SparkFunSuite
@@ -218,10 +217,10 @@ class FileStreamSinkLogSuite extends SparkFunSuite with SharedSQLContext {
218217
SQLConf.FILE_SINK_LOG_COMPACT_INTERVAL.key -> "3",
219218
SQLConf.FILE_SINK_LOG_CLEANUP_DELAY.key -> "0") {
220219
withFileStreamSinkLog { sinkLog =>
221-
val metadataPath = new File(sinkLog.metadataPath.toUri.toString)
220+
val fs = sinkLog.metadataPath.getFileSystem(sqlContext.sparkContext.hadoopConfiguration)
222221

223222
def listBatchFiles(): Set[String] = {
224-
metadataPath.listFiles().map(_.getName).filter { fileName =>
223+
fs.listStatus(sinkLog.metadataPath).map(_.getPath.getName).filter { fileName =>
225224
try {
226225
getBatchIdFromFileName(fileName)
227226
true

0 commit comments

Comments
 (0)