Skip to content

Commit 982995c

Browse files
author
YangSen-qn
committed
pfop pipline
1 parent b03b2c7 commit 982995c

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

src/main/java/com/qiniu/processing/OperationManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ public String pfop(String bucket, String key, StringMap params) throws QiniuExce
116116
}
117117
String pipeline = null;
118118
if (params.get("pipeline") != null) {
119-
if (params.get("pipeline") instanceof Integer) {
119+
if (params.get("pipeline") instanceof String) {
120120
pipeline = (String) params.get("pipeline");
121121
} else {
122-
throw QiniuException.unrecoverable("pipeline type error, String be Integer");
122+
throw QiniuException.unrecoverable("pipeline type error, should be String");
123123
}
124124
}
125125
String notifyUrl = null;

src/main/java/com/qiniu/storage/Region.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,12 +436,20 @@ public Builder region(String region) {
436436
}
437437

438438
public Builder srcUpHost(String... srcUpHosts) {
439-
this.region.srcUpHosts = Arrays.asList(srcUpHosts);
439+
if (srcUpHosts == null) {
440+
this.region.srcUpHosts = null;
441+
} else {
442+
this.region.srcUpHosts = Arrays.asList(srcUpHosts);
443+
}
440444
return this;
441445
}
442446

443447
public Builder accUpHost(String... accUpHosts) {
444-
this.region.accUpHosts = Arrays.asList(accUpHosts);
448+
if (accUpHosts == null) {
449+
this.region.accUpHosts = null;
450+
} else {
451+
this.region.accUpHosts = Arrays.asList(accUpHosts);
452+
}
445453
return this;
446454
}
447455

src/test/java/test/com/qiniu/processing/PfopTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void testPfop() throws QiniuException {
5757
System.out.println(fops);
5858

5959
try {
60-
String jobid = operationManager.pfop(bucket, TestConfig.testMp4FileKey, fops, null, notifyURL, force);
60+
String jobid = operationManager.pfop(bucket, TestConfig.testMp4FileKey, fops, "", notifyURL, force);
6161
assertNotNull(jobid);
6262
assertNotEquals("", jobid);
6363
ids.add(jobid);

src/test/java/test/com/qiniu/storage/FormUploadTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ public void testSimple() {
9595
@Tag("IntegrationTest")
9696
public void testEmptyUploadHosts() {
9797
Region region = new Region.Builder()
98+
.srcUpHost(null)
99+
.accUpHost(null)
98100
.build();
99101
Configuration config = new Configuration(region);
100102
UploadManager uploadManager = new UploadManager(config);

src/test/java/test/com/qiniu/storage/RegionTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package test.com.qiniu.storage;
22

3+
import com.qiniu.common.QiniuException;
34
import com.qiniu.storage.Region;
45
import org.junit.jupiter.api.Tag;
56
import org.junit.jupiter.api.Test;

0 commit comments

Comments
 (0)