aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-11-03 00:46:00 -0800
committerChris Lu <chris.lu@gmail.com>2020-11-03 00:46:00 -0800
commitc709059b690e2e5c70b262f4c884bb784cd1781a (patch)
tree902e4968ffdc36c104ed08f03edcacd6d0f15b11
parentd29b787220b9e4129ad91aec52f8731cccbb5001 (diff)
downloadseaweedfs-c709059b690e2e5c70b262f4c884bb784cd1781a.tar.xz
seaweedfs-c709059b690e2e5c70b262f4c884bb784cd1781a.zip
HCFS: add close() to SeaweedFileSystem.java
-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
-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
4 files changed, 28 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();
}
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 23556a578..cec309b3e 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();
}