aboutsummaryrefslogtreecommitdiff
path: root/other/java/hdfs3
diff options
context:
space:
mode:
authorhilimd <68371223+hilimd@users.noreply.github.com>2020-11-05 12:02:47 +0800
committerGitHub <noreply@github.com>2020-11-05 12:02:47 +0800
commit546f1bcb903dd26ba447cdbedb972736fdb31b42 (patch)
tree09b8119faa7162acaa7240de5af6fd0bebe96c2f /other/java/hdfs3
parent843865f2ca534bb6286b7a3d79c436384d875608 (diff)
parent75887ba2a20b9f3f7ff9c4b8998cf3af0c0f48c2 (diff)
downloadseaweedfs-546f1bcb903dd26ba447cdbedb972736fdb31b42.tar.xz
seaweedfs-546f1bcb903dd26ba447cdbedb972736fdb31b42.zip
Merge pull request #34 from chrislusf/master
sync
Diffstat (limited to 'other/java/hdfs3')
-rw-r--r--other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java6
-rw-r--r--other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java8
2 files changed, 14 insertions, 0 deletions
diff --git a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java
index ca67c3874..69df55cf1 100644
--- a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java
+++ b/other/java/hdfs3/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/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java
index 365149604..1ad809f9a 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();
}