diff options
| author | Konstantin Lebedev <lebedev_k@tochka.com> | 2020-11-19 18:16:44 +0500 |
|---|---|---|
| committer | Konstantin Lebedev <lebedev_k@tochka.com> | 2020-11-19 18:16:44 +0500 |
| commit | 27e73de7975ff9f097bbfd8d2717aa27931f25b5 (patch) | |
| tree | 802f8cf0f7cc6834e03a24700a8d07a218f5bd86 /other/java/hdfs3 | |
| parent | e1190b3224638616cf4e1318ddcba0b1575f2130 (diff) | |
| parent | da04bb3d1bb60d92fdacfb2edd8c8bdba2643038 (diff) | |
| download | seaweedfs-27e73de7975ff9f097bbfd8d2717aa27931f25b5.tar.xz seaweedfs-27e73de7975ff9f097bbfd8d2717aa27931f25b5.zip | |
Merge branch 'upstream_master' into store_s3cred
# Conflicts:
# weed/s3api/filer_util.go
Diffstat (limited to 'other/java/hdfs3')
4 files changed, 19 insertions, 4 deletions
diff --git a/other/java/hdfs3/dependency-reduced-pom.xml b/other/java/hdfs3/dependency-reduced-pom.xml index c4847a9b9..20b52e20f 100644 --- a/other/java/hdfs3/dependency-reduced-pom.xml +++ b/other/java/hdfs3/dependency-reduced-pom.xml @@ -309,7 +309,7 @@ </snapshotRepository>
</distributionManagement>
<properties>
- <seaweedfs.client.version>1.5.2</seaweedfs.client.version>
+ <seaweedfs.client.version>1.5.6</seaweedfs.client.version>
<hadoop.version>3.1.1</hadoop.version>
</properties>
</project>
diff --git a/other/java/hdfs3/pom.xml b/other/java/hdfs3/pom.xml index 9e668bba8..85d8db859 100644 --- a/other/java/hdfs3/pom.xml +++ b/other/java/hdfs3/pom.xml @@ -5,7 +5,7 @@ <modelVersion>4.0.0</modelVersion> <properties> - <seaweedfs.client.version>1.5.2</seaweedfs.client.version> + <seaweedfs.client.version>1.5.6</seaweedfs.client.version> <hadoop.version>3.1.1</hadoop.version> </properties> 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..fb1f4c53b 100644 --- a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java +++ b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java @@ -25,6 +25,7 @@ public class SeaweedFileSystem extends FileSystem { public static final String FS_SEAWEED_FILER_PORT = "fs.seaweed.filer.port"; public static final int FS_SEAWEED_DEFAULT_PORT = 8888; public static final String FS_SEAWEED_BUFFER_SIZE = "fs.seaweed.buffer.size"; + public static final String FS_SEAWEED_REPLICATION = "fs.seaweed.replication"; public static final int FS_SEAWEED_DEFAULT_BUFFER_SIZE = 4 * 1024 * 1024; private static final Logger LOG = LoggerFactory.getLogger(SeaweedFileSystem.class); @@ -66,6 +67,12 @@ public class SeaweedFileSystem extends FileSystem { } @Override + public void close() throws IOException { + super.close(); + this.seaweedFileSystemStore.close(); + } + + @Override public FSDataInputStream open(Path path, int bufferSize) throws IOException { LOG.debug("open path: {} bufferSize:{}", path, bufferSize); @@ -91,7 +98,7 @@ public class SeaweedFileSystem extends FileSystem { path = qualify(path); try { - String replicaPlacement = String.format("%03d", replication - 1); + String replicaPlacement = this.getConf().get(FS_SEAWEED_REPLICATION, String.format("%03d", replication - 1)); int seaweedBufferSize = this.getConf().getInt(FS_SEAWEED_BUFFER_SIZE, FS_SEAWEED_DEFAULT_BUFFER_SIZE); OutputStream outputStream = seaweedFileSystemStore.createFile(path, overwrite, permission, seaweedBufferSize, replicaPlacement); return new FSDataOutputStream(outputStream, statistics); 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..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(); } @@ -279,4 +287,4 @@ public class SeaweedFileSystemStore { } -} +}
\ No newline at end of file |
