aboutsummaryrefslogtreecommitdiff
path: root/other/java/client
diff options
context:
space:
mode:
authorKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2021-05-24 12:28:19 +0500
committerGitHub <noreply@github.com>2021-05-24 12:28:19 +0500
commit84dce32a5781268f6dbd0101e3bab65c04e0a1c7 (patch)
tree5eb4f327c53e2525d372d19bce62984539c62e71 /other/java/client
parentbb4263352251fb7ad02cfeb7f340b5b961d0d55a (diff)
parent359a08ecbad0b010811af367c2a2677fadfb53ae (diff)
downloadseaweedfs-84dce32a5781268f6dbd0101e3bab65c04e0a1c7.tar.xz
seaweedfs-84dce32a5781268f6dbd0101e3bab65c04e0a1c7.zip
Merge branch 'master' into head_check_all_chunks
Diffstat (limited to 'other/java/client')
-rw-r--r--other/java/client/pom.xml2
-rw-r--r--other/java/client/pom.xml.deploy2
-rw-r--r--other/java/client/pom_debug.xml2
-rw-r--r--other/java/client/src/main/java/seaweedfs/client/SeaweedOutputStream.java2
-rw-r--r--other/java/client/src/main/java/seaweedfs/client/SeaweedWrite.java8
5 files changed, 11 insertions, 5 deletions
diff --git a/other/java/client/pom.xml b/other/java/client/pom.xml
index a4231a1b8..d2c91b121 100644
--- a/other/java/client/pom.xml
+++ b/other/java/client/pom.xml
@@ -5,7 +5,7 @@
<groupId>com.github.chrislusf</groupId>
<artifactId>seaweedfs-client</artifactId>
- <version>1.6.5</version>
+ <version>1.6.6</version>
<parent>
<groupId>org.sonatype.oss</groupId>
diff --git a/other/java/client/pom.xml.deploy b/other/java/client/pom.xml.deploy
index 8fea51273..7910e2491 100644
--- a/other/java/client/pom.xml.deploy
+++ b/other/java/client/pom.xml.deploy
@@ -5,7 +5,7 @@
<groupId>com.github.chrislusf</groupId>
<artifactId>seaweedfs-client</artifactId>
- <version>1.6.5</version>
+ <version>1.6.6</version>
<parent>
<groupId>org.sonatype.oss</groupId>
diff --git a/other/java/client/pom_debug.xml b/other/java/client/pom_debug.xml
index 235af9526..c3cf904c0 100644
--- a/other/java/client/pom_debug.xml
+++ b/other/java/client/pom_debug.xml
@@ -5,7 +5,7 @@
<groupId>com.github.chrislusf</groupId>
<artifactId>seaweedfs-client</artifactId>
- <version>1.6.5</version>
+ <version>1.6.6</version>
<parent>
<groupId>org.sonatype.oss</groupId>
diff --git a/other/java/client/src/main/java/seaweedfs/client/SeaweedOutputStream.java b/other/java/client/src/main/java/seaweedfs/client/SeaweedOutputStream.java
index ba298a713..3bec05796 100644
--- a/other/java/client/src/main/java/seaweedfs/client/SeaweedOutputStream.java
+++ b/other/java/client/src/main/java/seaweedfs/client/SeaweedOutputStream.java
@@ -39,7 +39,7 @@ public class SeaweedOutputStream extends OutputStream {
}
public SeaweedOutputStream(FilerClient filerClient, final String fullpath, final String replication) {
- this(filerClient, fullpath, null, 0, 8 * 1024 * 1024, "000");
+ this(filerClient, fullpath, null, 0, 8 * 1024 * 1024, replication);
}
public SeaweedOutputStream(FilerClient filerClient, final String path, FilerProto.Entry.Builder entry,
diff --git a/other/java/client/src/main/java/seaweedfs/client/SeaweedWrite.java b/other/java/client/src/main/java/seaweedfs/client/SeaweedWrite.java
index f8c0c76b6..3f9d79b99 100644
--- a/other/java/client/src/main/java/seaweedfs/client/SeaweedWrite.java
+++ b/other/java/client/src/main/java/seaweedfs/client/SeaweedWrite.java
@@ -1,5 +1,6 @@
package seaweedfs.client;
+import com.google.common.base.Strings;
import com.google.protobuf.ByteString;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
@@ -45,11 +46,16 @@ public class SeaweedWrite {
FilerProto.AssignVolumeResponse response = filerClient.getBlockingStub().assignVolume(
FilerProto.AssignVolumeRequest.newBuilder()
.setCollection(filerClient.getCollection())
- .setReplication(replication == null ? filerClient.getReplication() : replication)
+ .setReplication(Strings.isNullOrEmpty(replication) ? filerClient.getReplication() : replication)
.setDataCenter("")
.setTtlSec(0)
.setPath(path)
.build());
+
+ if (!Strings.isNullOrEmpty(response.getError())) {
+ throw new IOException(response.getError());
+ }
+
String fileId = response.getFileId();
String auth = response.getAuth();