Merge pull request #34 from chrislusf/master

sync
This commit is contained in:
hilimd
2020-11-05 12:02:47 +08:00
committed by GitHub
50 changed files with 973 additions and 224 deletions

View File

@@ -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 {

View File

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

View File

@@ -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 {

View File

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