This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.0 by this push:
new c718494e0bf branch-4.0: [opt](load)mysql load use http utils to create
client #58450 (#58517)
c718494e0bf is described below
commit c718494e0bf6b173571c35895b7d02e752e1bc4e
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Dec 2 09:50:43 2025 +0800
branch-4.0: [opt](load)mysql load use http utils to create client #58450
(#58517)
Cherry-picked from #58450
Co-authored-by: koarz <[email protected]>
---
.../src/main/java/org/apache/doris/httpv2/rest/manager/HttpUtils.java | 4 ++++
.../src/main/java/org/apache/doris/load/loadv2/MysqlLoadManager.java | 3 ++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/manager/HttpUtils.java
b/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/manager/HttpUtils.java
index 988eccc0cc5..0c362279ab1 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/manager/HttpUtils.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/manager/HttpUtils.java
@@ -118,6 +118,10 @@ public class HttpUtils {
request.setConfig(config);
}
+ public static CloseableHttpClient getHttpClient() {
+ return HttpClientBuilder.create().build();
+ }
+
private static String executeRequest(HttpRequestBase request) throws
IOException {
CloseableHttpClient client = HttpClientBuilder.create().build();
return client.execute(request, httpResponse ->
EntityUtils.toString(httpResponse.getEntity()));
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/MysqlLoadManager.java
b/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/MysqlLoadManager.java
index 9ca03949884..2a04ec95246 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/MysqlLoadManager.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/MysqlLoadManager.java
@@ -32,6 +32,7 @@ import org.apache.doris.common.UserException;
import org.apache.doris.common.io.ByteBufferNetworkInputStream;
import org.apache.doris.datasource.property.fileformat.CsvFileFormatProperties;
import org.apache.doris.datasource.property.fileformat.FileFormatProperties;
+import org.apache.doris.httpv2.rest.manager.HttpUtils;
import org.apache.doris.load.LoadJobRowResult;
import org.apache.doris.load.StreamLoadHandler;
import org.apache.doris.mysql.MysqlSerializer;
@@ -185,7 +186,7 @@ public class MysqlLoadManager {
MySqlLoadContext loadContext = new MySqlLoadContext();
loadContextMap.put(loadId, loadContext);
LOG.info("Executing mysql load with id: {}.", loadId);
- try (final CloseableHttpClient httpclient =
HttpClients.createDefault()) {
+ try (final CloseableHttpClient httpclient = HttpUtils.getHttpClient())
{
for (String file : filePaths) {
InputStreamEntity entity = getInputStreamEntity(context,
clientLocal, file, loadId);
HttpPut request = generateRequestForMySqlLoadV2(entity,
dataDesc, database, table, token);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]