Skip to content

Commit

Permalink
pfop pipline
Browse files Browse the repository at this point in the history
  • Loading branch information
YangSen-qn committed Oct 25, 2024
1 parent b03b2c7 commit 982995c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/qiniu/processing/OperationManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ public String pfop(String bucket, String key, StringMap params) throws QiniuExce
}
String pipeline = null;
if (params.get("pipeline") != null) {
if (params.get("pipeline") instanceof Integer) {
if (params.get("pipeline") instanceof String) {
pipeline = (String) params.get("pipeline");
} else {
throw QiniuException.unrecoverable("pipeline type error, String be Integer");
throw QiniuException.unrecoverable("pipeline type error, should be String");
}
}
String notifyUrl = null;
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/com/qiniu/storage/Region.java
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,20 @@ public Builder region(String region) {
}

public Builder srcUpHost(String... srcUpHosts) {
this.region.srcUpHosts = Arrays.asList(srcUpHosts);
if (srcUpHosts == null) {
this.region.srcUpHosts = null;
} else {
this.region.srcUpHosts = Arrays.asList(srcUpHosts);
}
return this;
}

public Builder accUpHost(String... accUpHosts) {
this.region.accUpHosts = Arrays.asList(accUpHosts);
if (accUpHosts == null) {
this.region.accUpHosts = null;
} else {
this.region.accUpHosts = Arrays.asList(accUpHosts);
}
return this;
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/test/com/qiniu/processing/PfopTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void testPfop() throws QiniuException {
System.out.println(fops);

try {
String jobid = operationManager.pfop(bucket, TestConfig.testMp4FileKey, fops, null, notifyURL, force);
String jobid = operationManager.pfop(bucket, TestConfig.testMp4FileKey, fops, "", notifyURL, force);
assertNotNull(jobid);
assertNotEquals("", jobid);
ids.add(jobid);
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/test/com/qiniu/storage/FormUploadTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public void testSimple() {
@Tag("IntegrationTest")
public void testEmptyUploadHosts() {
Region region = new Region.Builder()
.srcUpHost(null)
.accUpHost(null)
.build();
Configuration config = new Configuration(region);
UploadManager uploadManager = new UploadManager(config);
Expand Down
1 change: 1 addition & 0 deletions src/test/java/test/com/qiniu/storage/RegionTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package test.com.qiniu.storage;

import com.qiniu.common.QiniuException;
import com.qiniu.storage.Region;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
Expand Down

0 comments on commit 982995c

Please sign in to comment.