aboutsummaryrefslogtreecommitdiff
path: root/other/java/hdfs2/src
diff options
context:
space:
mode:
Diffstat (limited to 'other/java/hdfs2/src')
-rw-r--r--other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java6
-rw-r--r--other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java8
2 files changed, 14 insertions, 0 deletions
diff --git a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java
index ca67c3874..69df55cf1 100644
--- a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java
+++ b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java
@@ -66,6 +66,12 @@ public class SeaweedFileSystem extends FileSystem {
}
@Override
+ public void close() throws IOException {
+ this.seaweedFileSystemStore.close();
+ super.close();
+ }
+
+ @Override
public FSDataInputStream open(Path path, int bufferSize) throws IOException {
LOG.debug("open path: {} bufferSize:{}", path, bufferSize);
diff --git a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java
index 23556a578..cec309b3e 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();
}