Skip to content

Commit

Permalink
[improvement] add http timeout for batch write (apache#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
JNSimba authored Mar 11, 2024
1 parent 6673462 commit a758cee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ public CloseableHttpClient getHttpClient() {
.setSocketTimeout(9 * 60 * 1000)
.build();

public CloseableHttpClient getHttpClientForBatch() {
return httpClientBuilder.setDefaultRequestConfig(requestConfig).build();
}

private final HttpClientBuilder httpClientBuilderWithTimeout =
HttpClients.custom().setDefaultRequestConfig(requestConfig);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class DorisBatchStreamLoad implements Serializable {
private final AtomicBoolean started;
private volatile boolean loadThreadAlive = false;
private AtomicReference<Throwable> exception = new AtomicReference<>(null);
private CloseableHttpClient httpClient = new HttpUtil().getHttpClient();
private CloseableHttpClient httpClient = new HttpUtil().getHttpClientForBatch();
private BackendUtil backendUtil;

public DorisBatchStreamLoad(
Expand Down

0 comments on commit a758cee

Please sign in to comment.