HCFS: add close() to SeaweedFileSystem.java
This commit is contained in:
@@ -65,6 +65,12 @@ public class SeaweedFileSystem extends FileSystem {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void close() throws IOException {
|
||||||
|
this.seaweedFileSystemStore.close();
|
||||||
|
super.close();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FSDataInputStream open(Path path, int bufferSize) throws IOException {
|
public FSDataInputStream open(Path path, int bufferSize) throws IOException {
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,14 @@ public class SeaweedFileSystemStore {
|
|||||||
this.conf = conf;
|
this.conf = conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void close() {
|
||||||
|
try {
|
||||||
|
this.filerGrpcClient.shutdown();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static String getParentDirectory(Path path) {
|
public static String getParentDirectory(Path path) {
|
||||||
return path.isRoot() ? "/" : path.getParent().toUri().getPath();
|
return path.isRoot() ? "/" : path.getParent().toUri().getPath();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,12 @@ public class SeaweedFileSystem extends FileSystem {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void close() throws IOException {
|
||||||
|
this.seaweedFileSystemStore.close();
|
||||||
|
super.close();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FSDataInputStream open(Path path, int bufferSize) throws IOException {
|
public FSDataInputStream open(Path path, int bufferSize) throws IOException {
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,14 @@ public class SeaweedFileSystemStore {
|
|||||||
this.conf = conf;
|
this.conf = conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void close() {
|
||||||
|
try {
|
||||||
|
this.filerGrpcClient.shutdown();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static String getParentDirectory(Path path) {
|
public static String getParentDirectory(Path path) {
|
||||||
return path.isRoot() ? "/" : path.getParent().toUri().getPath();
|
return path.isRoot() ? "/" : path.getParent().toUri().getPath();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user