Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JNSimba committed Mar 18, 2024
1 parent b283a91 commit b14a1b0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ public CloseableHttpClient getHttpClient() {
.build();

public HttpClientBuilder getHttpClientBuilderForBatch() {
return httpClientBuilder.setDefaultRequestConfig(requestConfig);
return HttpClients.custom()
.setRedirectStrategy(
new DefaultRedirectStrategy() {
@Override
protected boolean isRedirectable(String method) {
return true;
}
})
.setDefaultRequestConfig(requestConfig);
}

public HttpClientBuilder getHttpClientBuilderForCopyBatch() {
return HttpClients.custom()
.disableRedirectHandling()
.setDefaultRequestConfig(requestConfig);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ public class BatchStageLoad implements Serializable {
private final AtomicBoolean started;
private volatile boolean loadThreadAlive = false;
private AtomicReference<Throwable> exception = new AtomicReference<>(null);
private HttpClientBuilder httpClientBuilder =
new HttpUtil().getHttpClientBuilderForBatch().disableRedirectHandling();
private HttpClientBuilder httpClientBuilder = new HttpUtil().getHttpClientBuilderForCopyBatch();

public BatchStageLoad(
DorisOptions dorisOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class DorisCopyCommitter implements Committer<DorisCopyCommittable>, Clos
private static final String FAIL = "1";
private ObjectMapper objectMapper = new ObjectMapper();
private final DorisOptions dorisOptions;
private HttpClientBuilder httpClientBuilder = new HttpUtil().getHttpClientBuilderForBatch();
private HttpClientBuilder httpClientBuilder = new HttpUtil().getHttpClientBuilderForCopyBatch();
int maxRetry;

public DorisCopyCommitter(DorisOptions dorisOptions, int maxRetry) {
Expand Down

0 comments on commit b14a1b0

Please sign in to comment.