Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
import org.apache.spark.sql.SQLContext;
import org.apache.spark.sql.SparkSession;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.io.TempDir;

Expand Down Expand Up @@ -96,6 +97,7 @@ public class SparkClientFunctionalTestHarness implements SparkProvider, HoodieMe
private static transient JavaSparkContext jsc;
private static transient HoodieSparkEngineContext context;
private static transient TimelineService timelineService;
private FileSystem fileSystem;

/**
* An indicator of the initialization status.
Expand Down Expand Up @@ -128,7 +130,10 @@ public Configuration hadoopConf() {
}

public FileSystem fs() {
return FSUtils.getFs(basePath(), hadoopConf());
if (fileSystem == null) {
fileSystem = FSUtils.getFs(basePath(), hadoopConf());
}
return fileSystem;
}

@Override
Expand Down Expand Up @@ -208,6 +213,14 @@ public static synchronized void resetSpark() {
}
}

@AfterEach
public void closeFileSystem() throws IOException {
if (fileSystem != null) {
fileSystem.close();
fileSystem = null;
}
}

protected JavaRDD<HoodieRecord> tagLocation(
HoodieIndex index, JavaRDD<HoodieRecord> records, HoodieTable table) {
return HoodieJavaRDD.getJavaRDD(
Expand Down