Browse Source

HCFS: add close() to SeaweedFileSystem.java

pull/1598/head
Chris Lu 4 years ago
parent
commit
c709059b69
  1. 6
      other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java
  2. 8
      other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java
  3. 6
      other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java
  4. 8
      other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java

6
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();
}
@Override
public FSDataInputStream open(Path path, int bufferSize) throws IOException {

8
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();
}

6
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();
}
@Override
public FSDataInputStream open(Path path, int bufferSize) throws IOException {

8
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();
}

Loading…
Cancel
Save