SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
HCFS: add close() to SeaweedFileSystem.java
Chris Luc709059b690e
diff --git a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.javaindex ca67c38743..69df55cf1c 100644--- a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java+++ b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java@@ -65,6 +65,12 @@ public class SeaweedFileSystem extends FileSystem {}+ @Override+ public void close() throws IOException {+ this.seaweedFileSystemStore.close();+ super.close();+ }+@Overridepublic FSDataInputStream open(Path path, int bufferSize) throws IOException {diff --git a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.javaindex 23556a5785..cec309b3ea 100644--- a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java+++ b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java@@ -36,6 +36,14 @@ public class SeaweedFileSystemStore {this.conf = conf;}+ public void close() {+ try {+ this.filerGrpcClient.shutdown();+ } catch (InterruptedException e) {+ e.printStackTrace();+ }+ }+public static String getParentDirectory(Path path) {return path.isRoot() ? "/" : path.getParent().toUri().getPath();}diff --git a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.javaindex ca67c38743..69df55cf1c 100644--- a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java+++ b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java@@ -65,6 +65,12 @@ public class SeaweedFileSystem extends FileSystem {}+ @Override+ public void close() throws IOException {+ this.seaweedFileSystemStore.close();+ super.close();+ }+@Overridepublic FSDataInputStream open(Path path, int bufferSize) throws IOException {diff --git a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.javaindex 23556a5785..cec309b3ea 100644--- a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java+++ b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java@@ -36,6 +36,14 @@ public class SeaweedFileSystemStore {this.conf = conf;}+ public void close() {+ try {+ this.filerGrpcClient.shutdown();+ } catch (InterruptedException e) {+ e.printStackTrace();+ }+ }+public static String getParentDirectory(Path path) {return path.isRoot() ? "/" : path.getParent().toUri().getPath();}