You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "JNSimba (via GitHub)" <gi...@apache.org> on 2026/03/23 08:30:09 UTC
[PR] [Enhancement](sdk) Add java SDK as a subproject under sdk/java-doris-sdk [doris]
JNSimba opened a new pull request, #61626:
URL: https://github.com/apache/doris/pull/61626
### What problem does this PR solve?
The previous pull request (https://github.com/apache/doris/pull/58404) supported the Go SDK; this time, a Java version will be added based on it.
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg: https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Enhancement](sdk) Add java SDK as a subproject under sdk/java-doris-sdk [doris]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #61626:
URL: https://github.com/apache/doris/pull/61626#discussion_r2973885313
##########
sdk/java-doris-sdk/src/main/resources/log4j.properties:
##########
@@ -0,0 +1,23 @@
+################################################################################
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+################################################################################
+
+log4j.rootLogger=INFO, STDOUT
+
+log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
+log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
+log4j.appender.STDOUT.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5p %c - %m%n
Review Comment:
Shipping a `log4j.properties` in `src/main/resources` means the SDK jar can override an application's logging configuration at runtime. Libraries typically should not include logging config; move this to `src/test/resources` or the examples module, and let applications choose/configure their own logging backend.
```suggestion
################################################################################
```
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/DorisLoadClient.java:
##########
@@ -0,0 +1,227 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.sdk.load;
+
+import org.apache.doris.sdk.load.config.DorisConfig;
+import org.apache.doris.sdk.load.exception.StreamLoadException;
+import org.apache.doris.sdk.load.internal.RequestBuilder;
+import org.apache.doris.sdk.load.internal.StreamLoader;
+import org.apache.doris.sdk.load.model.LoadResponse;
+import org.apache.http.client.methods.HttpPut;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.zip.GZIPOutputStream;
+
+/**
+ * Thread-safe Doris stream load client.
+ *
+ * <p>Usage:
+ * <pre>
+ * DorisLoadClient client = new DorisLoadClient(config);
+ * LoadResponse resp = client.load(new ByteArrayInputStream(data));
+ * if (resp.getStatus() == LoadResponse.Status.SUCCESS) { ... }
+ * </pre>
+ *
+ * <p>Thread safety: this instance can be shared across threads.
+ * Each {@link #load} call must receive an independent InputStream.
+ */
+public class DorisLoadClient implements AutoCloseable {
+
+ private static final Logger log = LoggerFactory.getLogger(DorisLoadClient.class);
+ /** Absolute maximum for a single backoff interval: 5 minutes. */
+ private static final long ABSOLUTE_MAX_INTERVAL_MS = 300_000L;
+
+ private final DorisConfig config;
+ private final StreamLoader streamLoader;
+
+ public DorisLoadClient(DorisConfig config) {
+ this.config = config;
+ this.streamLoader = new StreamLoader();
+ }
+
+ /** Package-private constructor for testing with a mock StreamLoader. */
+ DorisLoadClient(DorisConfig config, StreamLoader streamLoader) {
+ this.config = config;
+ this.streamLoader = streamLoader;
+ }
+
+ /**
+ * Loads data from the given InputStream into Doris via stream load.
+ * The InputStream is fully consumed and buffered before the first attempt.
+ * Retries with exponential backoff on retryable errors (network/HTTP failures).
+ * Business failures (bad data, schema mismatch, auth) are returned immediately without retry.
+ *
+ * @param inputStream data to load (consumed once; must not be shared across threads)
+ * @return LoadResponse with status SUCCESS or FAILURE
+ * @throws IOException if the stream cannot be read or all retries are exhausted
+ */
+ public LoadResponse load(InputStream inputStream) throws IOException {
+ int maxRetries = 6;
+ long baseIntervalMs = 1000L;
+ long maxTotalTimeMs = 60000L;
+
+ if (config.getRetry() != null) {
+ maxRetries = config.getRetry().getMaxRetryTimes();
+ baseIntervalMs = config.getRetry().getBaseIntervalMs();
+ maxTotalTimeMs = config.getRetry().getMaxTotalTimeMs();
+ }
+
+ log.info("Starting stream load: {}.{}", config.getDatabase(), config.getTable());
+
+ // Buffer the InputStream once so retries can replay the body
+ byte[] bodyData = readAll(inputStream);
+
Review Comment:
`load(InputStream)` fully consumes the provided stream but does not close it, and the Javadoc doesn’t state who owns/should close the stream. For non-memory streams (e.g., `FileInputStream`) this can leak resources. Either document that the caller must close the stream, or wrap the read in a try-with-resources and take ownership explicitly.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/examples/DataGenerator.java:
##########
@@ -0,0 +1,148 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.sdk.examples;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Random;
+
+/**
+ * Unified data generation utilities for all Doris Stream Load examples.
+ * All examples use a unified Order schema for consistency.
+ *
+ * <p>Table DDL (orders):
+ * <pre>
+ * CREATE TABLE orders (
+ * order_id BIGINT,
+ * customer_id BIGINT,
+ * product_name VARCHAR(200),
+ * category VARCHAR(50),
+ * brand VARCHAR(50),
+ * quantity INT,
+ * unit_price DECIMAL(10,2),
+ * total_amount DECIMAL(10,2),
+ * status VARCHAR(20),
+ * order_date DATETIME,
+ * region VARCHAR(20)
+ * ) DISTRIBUTED BY HASH(order_id) BUCKETS 10
+ * PROPERTIES (
+ * "replication_allocation" = "tag.location.default: 1",
Review Comment:
The DDL snippet in the Javadoc has a trailing comma after the only property entry, which makes the SQL invalid as written. Please remove the extra comma (or add another property) so users can copy/paste the example DDL successfully.
```suggestion
* "replication_allocation" = "tag.location.default: 1"
```
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/examples/DataGenerator.java:
##########
@@ -0,0 +1,148 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.sdk.examples;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Random;
+
+/**
+ * Unified data generation utilities for all Doris Stream Load examples.
+ * All examples use a unified Order schema for consistency.
+ *
+ * <p>Table DDL (orders):
+ * <pre>
+ * CREATE TABLE orders (
+ * order_id BIGINT,
+ * customer_id BIGINT,
+ * product_name VARCHAR(200),
+ * category VARCHAR(50),
+ * brand VARCHAR(50),
+ * quantity INT,
+ * unit_price DECIMAL(10,2),
+ * total_amount DECIMAL(10,2),
+ * status VARCHAR(20),
+ * order_date DATETIME,
+ * region VARCHAR(20)
+ * ) DISTRIBUTED BY HASH(order_id) BUCKETS 10
+ * PROPERTIES (
+ * "replication_allocation" = "tag.location.default: 1",
+ * )
+ * </pre>
+ */
+public class DataGenerator {
+
+ private static final String[] CATEGORIES = {
+ "Electronics", "Clothing", "Books", "Home", "Sports",
+ "Beauty", "Automotive", "Food", "Health", "Toys"
+ };
+
+ private static final String[] BRANDS = {
+ "Apple", "Samsung", "Nike", "Adidas", "Sony",
+ "LG", "Canon", "Dell", "HP", "Xiaomi", "Huawei", "Lenovo"
+ };
+
+ private static final String[] STATUSES = {
+ "active", "inactive", "pending", "discontinued", "completed", "cancelled"
+ };
+
+ private static final String[] REGIONS = {"North", "South", "East", "West", "Central"};
+
+ /**
+ * Generates order data in CSV format.
+ *
+ * @param workerID worker ID (0 for single-threaded), used to offset order IDs
+ * @param batchSize number of records to generate
+ * @return CSV string (no header row)
+ */
+ public static String generateOrderCSV(int workerID, int batchSize) {
+ long seed = System.nanoTime() + (long) workerID * 1000;
+ Random rng = new Random(seed);
+ int baseOrderID = workerID * batchSize;
+
+ StringBuilder sb = new StringBuilder(batchSize * 200);
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+ for (int i = 1; i <= batchSize; i++) {
+ int quantity = rng.nextInt(10) + 1;
+ double unitPrice = (rng.nextInt(50000) + 1) / 100.0;
+ double totalAmount = quantity * unitPrice;
+ String productName = "Product_" + BRANDS[rng.nextInt(BRANDS.length)] + "_" + rng.nextInt(1000);
+ String category = CATEGORIES[rng.nextInt(CATEGORIES.length)];
+ String brand = BRANDS[rng.nextInt(BRANDS.length)];
+ String status = STATUSES[rng.nextInt(STATUSES.length)];
+ String region = REGIONS[rng.nextInt(REGIONS.length)];
+ long offsetMs = (long) rng.nextInt(365 * 24 * 3600) * 1000L;
+ String orderDate = sdf.format(new Date(System.currentTimeMillis() - offsetMs));
+
+ sb.append(baseOrderID + i).append(",")
+ .append(rng.nextInt(100000) + 1).append(",")
+ .append("\"").append(productName).append("\"").append(",")
+ .append(category).append(",")
+ .append(brand).append(",")
+ .append(quantity).append(",")
+ .append(String.format("%.2f", unitPrice)).append(",")
+ .append(String.format("%.2f", totalAmount)).append(",")
+ .append(status).append(",")
+ .append(orderDate).append(",")
+ .append(region).append("\n");
+ }
+ return sb.toString();
+ }
+
+ /**
+ * Generates order data in JSON Lines format (one JSON object per line).
+ *
+ * @param workerID worker ID (0 for single-threaded)
+ * @param batchSize number of records to generate
+ * @return JSON Lines string
+ */
+ public static String generateOrderJSON(int workerID, int batchSize) {
+ long seed = System.nanoTime() + (long) workerID * 1000;
+ Random rng = new Random(seed);
+ int baseOrderID = workerID * batchSize;
+
+ StringBuilder sb = new StringBuilder(batchSize * 300);
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
+
+ for (int i = 1; i <= batchSize; i++) {
+ int quantity = rng.nextInt(10) + 1;
+ double unitPrice = (rng.nextInt(50000) + 1) / 100.0;
+ double totalAmount = quantity * unitPrice;
+ String productName = "Product_" + BRANDS[rng.nextInt(BRANDS.length)] + "_" + rng.nextInt(1000);
+ String category = CATEGORIES[rng.nextInt(CATEGORIES.length)];
+ String brand = BRANDS[rng.nextInt(BRANDS.length)];
+ String status = STATUSES[rng.nextInt(STATUSES.length)];
+ String region = REGIONS[rng.nextInt(REGIONS.length)];
+ long offsetMs = (long) rng.nextInt(365 * 24 * 3600) * 1000L;
+ String orderDate = sdf.format(new Date(System.currentTimeMillis() - offsetMs));
Review Comment:
`generateOrderJSON()` formats timestamps with a literal `'Z'` suffix but does not set the formatter timezone to UTC, so the produced strings look like UTC while actually representing local time. Either set the `SimpleDateFormat` timezone to UTC, or remove the `'Z'` suffix / use a local-time format to avoid misleading example data.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/internal/StreamLoader.java:
##########
@@ -0,0 +1,149 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.sdk.load.internal;
+
+import org.apache.doris.sdk.load.exception.StreamLoadException;
+import org.apache.doris.sdk.load.model.LoadResponse;
+import org.apache.doris.sdk.load.model.RespContent;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.conn.ssl.NoopHostnameVerifier;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.DefaultRedirectStrategy;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.ssl.SSLContextBuilder;
+import org.apache.http.util.EntityUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * Uses RedirectStrategy so that 307 redirects on PUT requests are
+ * followed automatically (Doris FE redirects stream load to BE).
+ */
+public class StreamLoader implements AutoCloseable {
+
+ private static final Logger log = LoggerFactory.getLogger(StreamLoader.class);
+ private static final int SOCKET_TIMEOUT_MS = 9 * 60 * 1000;
+ private static final int CONNECT_TIMEOUT_MS = 60_000;
+
+ private final HttpClientBuilder httpClientBuilder;
+ private final ObjectMapper objectMapper;
+
+ public StreamLoader() {
+ this.httpClientBuilder = buildHttpClient();
+ this.objectMapper = new ObjectMapper();
+ }
+
+ /** Package-private constructor for testing with a mock HTTP client. */
+ StreamLoader(HttpClientBuilder httpClientBuilder) {
+ this.httpClientBuilder = httpClientBuilder;
+ this.objectMapper = new ObjectMapper();
+ }
+
+ /**
+ * Executes the HTTP PUT request and returns a LoadResponse.
+ *
+ * @throws StreamLoadException for retryable HTTP-level errors (non-200 status, connection failure)
+ * @throws IOException for unrecoverable I/O errors
+ */
+ public LoadResponse execute(HttpPut request) throws IOException {
Review Comment:
The Javadoc says this method can throw `IOException` for unrecoverable I/O errors, but the implementation wraps all `IOException` into `StreamLoadException` (runtime). Either adjust the Javadoc/signature to reflect actual behavior, or allow non-retryable I/O errors (e.g., JSON parse) to propagate as `IOException`.
```suggestion
* @throws StreamLoadException for HTTP-level errors (non-200 status, connection failure)
* and unrecoverable I/O errors (including JSON parse failures)
*/
public LoadResponse execute(HttpPut request) {
```
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/internal/StreamLoader.java:
##########
@@ -0,0 +1,149 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.sdk.load.internal;
+
+import org.apache.doris.sdk.load.exception.StreamLoadException;
+import org.apache.doris.sdk.load.model.LoadResponse;
+import org.apache.doris.sdk.load.model.RespContent;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.conn.ssl.NoopHostnameVerifier;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.DefaultRedirectStrategy;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.ssl.SSLContextBuilder;
+import org.apache.http.util.EntityUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * Uses RedirectStrategy so that 307 redirects on PUT requests are
+ * followed automatically (Doris FE redirects stream load to BE).
+ */
+public class StreamLoader implements AutoCloseable {
+
+ private static final Logger log = LoggerFactory.getLogger(StreamLoader.class);
+ private static final int SOCKET_TIMEOUT_MS = 9 * 60 * 1000;
+ private static final int CONNECT_TIMEOUT_MS = 60_000;
+
+ private final HttpClientBuilder httpClientBuilder;
+ private final ObjectMapper objectMapper;
+
+ public StreamLoader() {
+ this.httpClientBuilder = buildHttpClient();
+ this.objectMapper = new ObjectMapper();
+ }
+
+ /** Package-private constructor for testing with a mock HTTP client. */
+ StreamLoader(HttpClientBuilder httpClientBuilder) {
+ this.httpClientBuilder = httpClientBuilder;
+ this.objectMapper = new ObjectMapper();
+ }
+
+ /**
+ * Executes the HTTP PUT request and returns a LoadResponse.
+ *
+ * @throws StreamLoadException for retryable HTTP-level errors (non-200 status, connection failure)
+ * @throws IOException for unrecoverable I/O errors
+ */
+ public LoadResponse execute(HttpPut request) throws IOException {
+ log.debug("Sending HTTP PUT to {}", request.getURI());
+ long start = System.currentTimeMillis();
+
+ try (CloseableHttpClient httpClient = httpClientBuilder.build();
+ CloseableHttpResponse response = httpClient.execute(request)) {
+ int statusCode = response.getStatusLine().getStatusCode();
Review Comment:
`execute()` builds and closes a new `CloseableHttpClient` for every request. This prevents connection pooling/keep-alive reuse and adds significant overhead under concurrency. Consider keeping a single `CloseableHttpClient` instance in `StreamLoader` (built once from the builder) and closing it in `close()`.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/internal/RequestBuilder.java:
##########
@@ -0,0 +1,166 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.sdk.load.internal;
+
+import org.apache.doris.sdk.load.config.DorisConfig;
+import org.apache.doris.sdk.load.config.GroupCommitMode;
Review Comment:
`GroupCommitMode` is imported but never referenced by name (the `switch` cases resolve from the expression type). This creates an unused import warning and can fail builds that enable unused-import checks. Please remove the unused import.
```suggestion
```
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/internal/RequestBuilder.java:
##########
@@ -0,0 +1,166 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.sdk.load.internal;
+
+import org.apache.doris.sdk.load.config.DorisConfig;
+import org.apache.doris.sdk.load.config.GroupCommitMode;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.entity.ByteArrayEntity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.UUID;
+
+/**
+ * Builds HttpPut requests for Doris stream load.
+ * Handles header assembly, label generation, and group commit logic.
+ */
+public class RequestBuilder {
+
+ private static final Logger log = LoggerFactory.getLogger(RequestBuilder.class);
+ private static final String STREAM_LOAD_PATTERN = "http://%s/api/%s/%s/_stream_load";
+ private static final Random RANDOM = new Random();
+
+ /**
+ * Builds an HttpPut request for the given config and data.
+ *
+ * @param config DorisConfig
+ * @param data pre-buffered (and optionally pre-compressed) request body bytes
+ * @param attempt 0 = first attempt, >0 = retry number
+ */
+ public static HttpPut build(DorisConfig config, byte[] data, int attempt) throws Exception {
+ String host = pickEndpoint(config.getEndpoints());
+ String url = String.format(STREAM_LOAD_PATTERN, host, config.getDatabase(), config.getTable());
+
Review Comment:
`STREAM_LOAD_PATTERN` hard-codes the `http://` scheme, but `pickEndpoint()` strips both `http://` and `https://`. If a user configures `https://...` endpoints, requests will still be sent over plain HTTP. Consider preserving the endpoint scheme (or parsing the endpoint as a URL and reusing its scheme) when building the stream load URL.
##########
sdk/java-doris-sdk/pom.xml:
##########
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.doris</groupId>
+ <artifactId>java-doris-sdk</artifactId>
+ <version>1.0.0</version>
+ <packaging>jar</packaging>
+
+ <name>Apache Doris Java SDK</name>
+ <description>A lightweight Apache Doris Stream Load client (Java version)</description>
+
+ <properties>
+ <maven.compiler.source>8</maven.compiler.source>
+ <maven.compiler.target>8</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <!-- HTTP client -->
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.5.13</version>
+ </dependency>
+
+ <!-- JSON serialization -->
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>2.13.5</version>
+ </dependency>
+
+ <!-- Logging facade -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.7.9</version>
+ </dependency>
Review Comment:
This module depends on `slf4j-log4j12` (Log4j 1.x binding) as a main dependency, which (1) forces a logging backend on all SDK consumers and (2) pulls in the EOL Log4j 1.x stack with known security issues. Prefer depending on `slf4j-api` only, and add a backend (e.g., `slf4j-simple`/logback) only for tests/examples.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/DorisLoadClient.java:
##########
@@ -0,0 +1,227 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.sdk.load;
+
+import org.apache.doris.sdk.load.config.DorisConfig;
+import org.apache.doris.sdk.load.exception.StreamLoadException;
+import org.apache.doris.sdk.load.internal.RequestBuilder;
+import org.apache.doris.sdk.load.internal.StreamLoader;
+import org.apache.doris.sdk.load.model.LoadResponse;
+import org.apache.http.client.methods.HttpPut;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.zip.GZIPOutputStream;
+
+/**
+ * Thread-safe Doris stream load client.
+ *
+ * <p>Usage:
+ * <pre>
+ * DorisLoadClient client = new DorisLoadClient(config);
+ * LoadResponse resp = client.load(new ByteArrayInputStream(data));
+ * if (resp.getStatus() == LoadResponse.Status.SUCCESS) { ... }
+ * </pre>
+ *
+ * <p>Thread safety: this instance can be shared across threads.
+ * Each {@link #load} call must receive an independent InputStream.
+ */
+public class DorisLoadClient implements AutoCloseable {
+
+ private static final Logger log = LoggerFactory.getLogger(DorisLoadClient.class);
+ /** Absolute maximum for a single backoff interval: 5 minutes. */
+ private static final long ABSOLUTE_MAX_INTERVAL_MS = 300_000L;
+
+ private final DorisConfig config;
+ private final StreamLoader streamLoader;
+
+ public DorisLoadClient(DorisConfig config) {
+ this.config = config;
+ this.streamLoader = new StreamLoader();
+ }
+
+ /** Package-private constructor for testing with a mock StreamLoader. */
+ DorisLoadClient(DorisConfig config, StreamLoader streamLoader) {
+ this.config = config;
+ this.streamLoader = streamLoader;
+ }
+
+ /**
+ * Loads data from the given InputStream into Doris via stream load.
+ * The InputStream is fully consumed and buffered before the first attempt.
+ * Retries with exponential backoff on retryable errors (network/HTTP failures).
+ * Business failures (bad data, schema mismatch, auth) are returned immediately without retry.
+ *
+ * @param inputStream data to load (consumed once; must not be shared across threads)
+ * @return LoadResponse with status SUCCESS or FAILURE
+ * @throws IOException if the stream cannot be read or all retries are exhausted
+ */
+ public LoadResponse load(InputStream inputStream) throws IOException {
+ int maxRetries = 6;
+ long baseIntervalMs = 1000L;
+ long maxTotalTimeMs = 60000L;
+
+ if (config.getRetry() != null) {
+ maxRetries = config.getRetry().getMaxRetryTimes();
+ baseIntervalMs = config.getRetry().getBaseIntervalMs();
+ maxTotalTimeMs = config.getRetry().getMaxTotalTimeMs();
+ }
+
+ log.info("Starting stream load: {}.{}", config.getDatabase(), config.getTable());
+
+ // Buffer the InputStream once so retries can replay the body
+ byte[] bodyData = readAll(inputStream);
+
+ // Compress once before the retry loop (avoids re-compressing on each retry)
+ if (config.isEnableGzip()) {
+ bodyData = gzipCompress(bodyData);
+ }
+ Exception lastException = null;
+ LoadResponse lastResponse = null;
+ long operationStart = System.currentTimeMillis();
+
+ for (int attempt = 0; attempt <= maxRetries; attempt++) {
+ if (attempt > 0) {
+ log.info("Retry attempt {}/{}", attempt, maxRetries);
+ // Use actual wall-clock elapsed time (includes request time, not just sleep time)
+ long elapsed = System.currentTimeMillis() - operationStart;
+ long backoff = calculateBackoffMs(attempt, baseIntervalMs, maxTotalTimeMs, elapsed);
+
+ if (maxTotalTimeMs > 0 && elapsed + backoff > maxTotalTimeMs) {
+ log.warn("Next retry backoff ({}ms) would exceed total limit ({}ms). Stopping.", backoff, maxTotalTimeMs);
+ break;
+ }
+
+ log.info("Waiting {}ms before retry (elapsed so far: {}ms)", backoff, elapsed);
+ sleep(backoff);
+ } else {
+ log.info("Initial load attempt");
+ }
+
+ try {
+ HttpPut request = RequestBuilder.build(config, bodyData, attempt);
+ lastResponse = streamLoader.execute(request);
+
+ if (lastResponse.getStatus() == LoadResponse.Status.SUCCESS) {
+ log.info("Stream load succeeded on attempt {}", attempt + 1);
+ return lastResponse;
+ }
+
+ // Business failure (bad data, schema mismatch, auth) — do not retry
+ log.error("Load failed (non-retryable): {}", lastResponse.getErrorMessage());
+ return lastResponse;
+
+ } catch (StreamLoadException e) {
+ // Retryable: network error, HTTP 5xx, etc.
+ lastException = e;
+ log.error("Attempt {} failed with retryable error: ", attempt + 1, e);
+
+ // Check elapsed wall-clock time (same guard as the Exception branch below)
+ long elapsed = System.currentTimeMillis() - operationStart;
+ if (maxTotalTimeMs > 0 && elapsed > maxTotalTimeMs) {
+ log.warn("Total elapsed time ({}ms) exceeded limit ({}ms), stopping retries.", elapsed, maxTotalTimeMs);
+ break;
+ }
+ } catch (Exception e) {
+ // Wrap unexpected exceptions as retryable
+ lastException = new StreamLoadException("Unexpected error building request: " + e.getMessage(), e);
+ log.error("Attempt {} failed with unexpected error: ", attempt + 1, e);
+
+ // Check elapsed wall-clock time
+ long elapsed = System.currentTimeMillis() - operationStart;
+ if (maxTotalTimeMs > 0 && elapsed > maxTotalTimeMs) {
+ log.warn("Total elapsed time ({}ms) exceeded limit ({}ms), stopping retries.", elapsed, maxTotalTimeMs);
+ break;
+ }
+ }
+ }
+
+ log.debug("Total operation time: {}ms", System.currentTimeMillis() - operationStart);
+
+ if (lastException != null) {
+ throw new IOException("Stream load failed after " + (maxRetries + 1) + " attempts", lastException);
+ }
+
+ if (lastResponse != null) {
+ return lastResponse;
+ }
+
+ throw new IOException("Stream load failed: unknown error");
+ }
+
+ /**
+ * Calculates exponential backoff interval in milliseconds.
+ * Package-private for unit testing.
+ *
+ * Formula: base * 2^(attempt-1), constrained by remaining total time and absolute max.
+ *
+ * @param elapsedMs actual wall-clock time elapsed since the operation started (includes request time)
+ */
+ static long calculateBackoffMs(int attempt, long baseIntervalMs, long maxTotalTimeMs, long elapsedMs) {
+ if (attempt <= 0) return 0;
+ long intervalMs = baseIntervalMs * (1L << (attempt - 1)); // base * 2^(attempt-1)
+
+ if (maxTotalTimeMs > 0) {
+ long remaining = maxTotalTimeMs - elapsedMs - 5000; // reserve 5s for the next request
+ if (remaining <= 0) {
+ intervalMs = 0;
+ } else if (intervalMs > remaining) {
+ intervalMs = remaining;
+ }
+ }
+
+ if (intervalMs > ABSOLUTE_MAX_INTERVAL_MS) intervalMs = ABSOLUTE_MAX_INTERVAL_MS;
+ if (intervalMs < 0) intervalMs = 0;
+ return intervalMs;
Review Comment:
`calculateBackoffMs` uses bit shifting (`1L << (attempt - 1)`) which overflows for large `attempt` values (>= 64), resulting in negative/zero intervals and breaking backoff behavior. Consider capping the exponent (e.g., `Math.min(attempt - 1, 30)`), or using a safe multiply loop/`Math.multiplyExact` with overflow handling.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/internal/StreamLoader.java:
##########
@@ -0,0 +1,149 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.sdk.load.internal;
+
+import org.apache.doris.sdk.load.exception.StreamLoadException;
+import org.apache.doris.sdk.load.model.LoadResponse;
+import org.apache.doris.sdk.load.model.RespContent;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.conn.ssl.NoopHostnameVerifier;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.DefaultRedirectStrategy;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.ssl.SSLContextBuilder;
+import org.apache.http.util.EntityUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * Uses RedirectStrategy so that 307 redirects on PUT requests are
+ * followed automatically (Doris FE redirects stream load to BE).
+ */
+public class StreamLoader implements AutoCloseable {
+
+ private static final Logger log = LoggerFactory.getLogger(StreamLoader.class);
+ private static final int SOCKET_TIMEOUT_MS = 9 * 60 * 1000;
+ private static final int CONNECT_TIMEOUT_MS = 60_000;
+
+ private final HttpClientBuilder httpClientBuilder;
+ private final ObjectMapper objectMapper;
+
+ public StreamLoader() {
+ this.httpClientBuilder = buildHttpClient();
+ this.objectMapper = new ObjectMapper();
+ }
+
+ /** Package-private constructor for testing with a mock HTTP client. */
+ StreamLoader(HttpClientBuilder httpClientBuilder) {
+ this.httpClientBuilder = httpClientBuilder;
+ this.objectMapper = new ObjectMapper();
+ }
+
+ /**
+ * Executes the HTTP PUT request and returns a LoadResponse.
+ *
+ * @throws StreamLoadException for retryable HTTP-level errors (non-200 status, connection failure)
+ * @throws IOException for unrecoverable I/O errors
+ */
+ public LoadResponse execute(HttpPut request) throws IOException {
+ log.debug("Sending HTTP PUT to {}", request.getURI());
+ long start = System.currentTimeMillis();
+
+ try (CloseableHttpClient httpClient = httpClientBuilder.build();
+ CloseableHttpResponse response = httpClient.execute(request)) {
+ int statusCode = response.getStatusLine().getStatusCode();
+ log.debug("HTTP response status: {}", statusCode);
+ log.debug("HTTP request completed in {} ms", System.currentTimeMillis() - start);
+
+ if (statusCode == 200) {
+ return parseResponse(response);
+ } else {
+ // Non-200 is retryable (e.g. 503, 429)
+ throw new StreamLoadException("stream load error: " + response.getStatusLine().toString());
+ }
+ } catch (StreamLoadException e) {
+ throw e;
+ } catch (IOException e) {
+ throw new StreamLoadException("stream load request failed: " + e.getMessage(), e);
+ }
+ }
+
+ private LoadResponse parseResponse(CloseableHttpResponse response) throws IOException {
+ byte[] bodyBytes = EntityUtils.toByteArray(response.getEntity());
+ String body = new String(bodyBytes, StandardCharsets.UTF_8);
+ log.info("Stream Load Response: {}", body);
+
+ RespContent resp = objectMapper.readValue(body, RespContent.class);
+
+ if (isSuccess(resp.getStatus())) {
+ log.info("Load operation completed successfully");
+ return LoadResponse.success(resp);
+ } else {
+ log.error("Load operation failed with status: {}", resp.getStatus());
+ String errorMsg;
+ if (resp.getMessage() != null && !resp.getMessage().isEmpty()) {
+ errorMsg = "load failed. cause by: " + resp.getMessage()
+ + ", please check more detail from url: " + resp.getErrorUrl();
+ } else {
+ errorMsg = body;
+ }
+ return LoadResponse.failure(resp, errorMsg);
+ }
+ }
+
+ private static boolean isSuccess(String status) {
+ return "success".equalsIgnoreCase(status);
+ }
+
+ private static HttpClientBuilder buildHttpClient() {
+ try {
+ RequestConfig requestConfig = RequestConfig.custom()
+ .setConnectTimeout(CONNECT_TIMEOUT_MS)
+ .setSocketTimeout(SOCKET_TIMEOUT_MS)
+ .setConnectionRequestTimeout(CONNECT_TIMEOUT_MS)
+ .build();
+
+ return HttpClientBuilder.create()
+ .setDefaultRequestConfig(requestConfig)
+ .setRedirectStrategy(new DefaultRedirectStrategy() {
+ @Override
+ protected boolean isRedirectable(String method) {
+ return true;
+ }
+ })
+ .setSSLSocketFactory(
+ new SSLConnectionSocketFactory(
+ SSLContextBuilder.create()
+ .loadTrustMaterial(null, (chain, authType) -> true)
+ .build(),
+ NoopHostnameVerifier.INSTANCE));
Review Comment:
`buildHttpClient()` configures an SSL context that trusts all certificates and disables hostname verification. This effectively removes TLS security (MITM is possible) for any https endpoint. Prefer using the JVM default trust store/hostname verifier, or make an explicit `insecureSkipVerify`-style option that is off by default and clearly documented.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Enhancement](sdk) Add java SDK as a subproject under sdk/java-doris-sdk [doris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #61626:
URL: https://github.com/apache/doris/pull/61626#issuecomment-4115046494
PR approved by anyone and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Enhancement](sdk) Add java SDK as a subproject under sdk/java-doris-sdk [doris]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #61626:
URL: https://github.com/apache/doris/pull/61626#discussion_r2973588283
##########
sdk/java-doris-sdk/src/test/java/org/apache/doris/sdk/load/config/FormatTest.java:
##########
@@ -0,0 +1,47 @@
+package org.apache.doris.sdk.load.config;
+
+import org.junit.Test;
Review Comment:
This new test file is missing the standard ASF license header comment block used across Doris Java sources/tests. Add the Apache license header for consistency/compliance.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/internal/StreamLoader.java:
##########
@@ -0,0 +1,135 @@
+package org.apache.doris.sdk.load.internal;
+
+import org.apache.doris.sdk.load.exception.StreamLoadException;
+import org.apache.doris.sdk.load.model.LoadResponse;
+import org.apache.doris.sdk.load.model.RespContent;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.conn.ssl.NoopHostnameVerifier;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.DefaultRedirectStrategy;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.ssl.SSLContextBuilder;
+import org.apache.http.util.EntityUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * Executes a single HTTP PUT request and parses the Doris response.
+ * Thread-safe: CloseableHttpClient is shared and reused across calls.
+ *
+ * Uses LaxRedirectStrategy so that 307 redirects on PUT requests are
+ * followed automatically (Doris FE redirects stream load to BE).
+ */
+public class StreamLoader implements AutoCloseable {
+
+ private static final Logger log = LoggerFactory.getLogger(StreamLoader.class);
+ private static final int SOCKET_TIMEOUT_MS = 9 * 60 * 1000;
+ private static final int CONNECT_TIMEOUT_MS = 60_000;
+
+ private final HttpClientBuilder httpClientBuilder;
+ private final ObjectMapper objectMapper;
+
+ public StreamLoader() {
+ this.httpClientBuilder = buildHttpClient();
+ this.objectMapper = new ObjectMapper();
+ }
+
+ /** Package-private constructor for testing with a mock HTTP client. */
+ StreamLoader(HttpClientBuilder httpClientBuilder) {
+ this.httpClientBuilder = httpClientBuilder;
+ this.objectMapper = new ObjectMapper();
+ }
+
+ /**
+ * Executes the HTTP PUT request and returns a LoadResponse.
+ *
+ * @throws StreamLoadException for retryable HTTP-level errors (non-200 status, connection failure)
+ * @throws IOException for unrecoverable I/O errors
+ */
+ public LoadResponse execute(HttpPut request) throws IOException {
+ log.debug("Sending HTTP PUT to {}", request.getURI());
+ long start = System.currentTimeMillis();
+
+ try (CloseableHttpClient httpClient = httpClientBuilder.build();
+ CloseableHttpResponse response = httpClient.execute(request)) {
+ int statusCode = response.getStatusLine().getStatusCode();
Review Comment:
The class Javadoc says the `CloseableHttpClient` is shared and reused across calls, but `execute()` builds and closes a new client on every request (`httpClientBuilder.build()` in try-with-resources). This hurts performance and also makes `close()` a no-op. Consider constructing a single `CloseableHttpClient` once (field), reusing it across calls, and closing it in `close()`, or update the docs if per-request clients are intentional.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/config/CsvFormat.java:
##########
@@ -0,0 +1,35 @@
+package org.apache.doris.sdk.load.config;
+
+import java.util.HashMap;
Review Comment:
This new source file is missing the standard ASF license header comment block that appears at the top of other Doris Java files. Add the Apache license header to align with repository conventions/compliance.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/internal/RequestBuilder.java:
##########
@@ -0,0 +1,144 @@
+package org.apache.doris.sdk.load.internal;
+
+import org.apache.doris.sdk.load.config.DorisConfig;
+import org.apache.doris.sdk.load.config.GroupCommitMode;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.entity.ByteArrayEntity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.UUID;
+
+/**
+ * Builds HttpPut requests for Doris stream load.
+ * Handles header assembly, label generation, and group commit logic.
+ */
+public class RequestBuilder {
+
+ private static final Logger log = LoggerFactory.getLogger(RequestBuilder.class);
+ private static final String STREAM_LOAD_PATTERN = "http://%s/api/%s/%s/_stream_load";
+ private static final Random RANDOM = new Random();
+
+ /**
+ * Builds an HttpPut request for the given config and data.
+ *
+ * @param config DorisConfig
+ * @param data pre-buffered (and optionally pre-compressed) request body bytes
+ * @param attempt 0 = first attempt, >0 = retry number
+ */
+ public static HttpPut build(DorisConfig config, byte[] data, int attempt) throws Exception {
+ String host = pickEndpoint(config.getEndpoints());
+ String url = String.format(STREAM_LOAD_PATTERN, host, config.getDatabase(), config.getTable());
+
+ HttpPut request = new HttpPut(url);
+ request.setEntity(new ByteArrayEntity(data));
+
+ // Basic auth
+ String credentials = config.getUser() + ":" + config.getPassword();
+ String encoded = Base64.getEncoder().encodeToString(credentials.getBytes(StandardCharsets.UTF_8));
+ request.setHeader("Authorization", "Basic " + encoded);
+ request.setHeader("Expect", "100-continue");
+
+ // Build and apply all stream load headers
+ Map<String, String> allHeaders = buildStreamLoadHeaders(config);
+ for (Map.Entry<String, String> entry : allHeaders.entrySet()) {
+ request.setHeader(entry.getKey(), entry.getValue());
+ }
+
+ // Label handling: skip labels when group commit is enabled
+ boolean groupCommitEnabled = allHeaders.containsKey("group_commit");
+ if (groupCommitEnabled) {
+ if (config.getLabel() != null && !config.getLabel().isEmpty()) {
+ log.warn("Custom label '{}' specified but group_commit is enabled. Removing label.", config.getLabel());
+ }
+ if (config.getLabelPrefix() != null && !config.getLabelPrefix().isEmpty()) {
+ log.warn("Label prefix '{}' specified but group_commit is enabled. Removing label prefix.", config.getLabelPrefix());
+ }
+ log.info("Group commit enabled - labels removed from request headers");
Review Comment:
When group commit is enabled you log that labels are removed, but `buildStreamLoadHeaders()` blindly copies `config.getOptions()` into headers first. If users pass `options.put("label", ...)`, the label header will still be sent even when group commit is enabled. Consider explicitly removing/ignoring the `label` header from options (and warning) when `group_commit` is set.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/config/GroupCommitMode.java:
##########
@@ -0,0 +1,14 @@
+package org.apache.doris.sdk.load.config;
+
+/**
Review Comment:
This new source file is missing the standard ASF license header comment block that appears at the top of other Doris Java files. Add the Apache license header to align with repository conventions/compliance.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/config/DorisConfig.java:
##########
@@ -0,0 +1,129 @@
+package org.apache.doris.sdk.load.config;
+
+import java.util.Collections;
Review Comment:
This new source file is missing the standard ASF license header comment block that appears at the top of other Doris Java files. Add the Apache license header to align with repository conventions/compliance.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/DorisClient.java:
##########
@@ -0,0 +1,65 @@
+package org.apache.doris.sdk;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
Review Comment:
This new source file is missing the standard ASF license header comment block that appears at the top of other Doris Java files. Add the Apache license header to align with repository conventions/compliance.
##########
sdk/java-doris-sdk/pom.xml:
##########
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.doris</groupId>
+ <artifactId>java-doris-sdk</artifactId>
+ <version>1.0.0</version>
+ <packaging>jar</packaging>
+
+ <name>Apache Doris Java SDK</name>
+ <description>A lightweight Apache Doris Stream Load client (Java version)</description>
+
+ <properties>
+ <maven.compiler.source>8</maven.compiler.source>
+ <maven.compiler.target>8</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <!-- HTTP client -->
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.5.13</version>
+ </dependency>
+
+ <!-- JSON serialization -->
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>2.13.4</version>
+ </dependency>
+
+ <!-- Logging facade -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.7.9</version>
Review Comment:
This module depends on `slf4j-log4j12`, which pulls in Log4j 1.x (end-of-life and affected by known security issues). For a new SDK subproject, prefer a modern backend (e.g., logback-classic or Log4j2 via `log4j-slf4j-impl`) and keep the main artifact depending only on `slf4j-api` where possible.
```suggestion
<!-- Logging facade: depend only on SLF4J API, let consumers choose backend -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
```
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/config/Format.java:
##########
@@ -0,0 +1,15 @@
+package org.apache.doris.sdk.load.config;
+
+import java.util.Map;
Review Comment:
This new source file is missing the standard ASF license header comment block that appears at the top of other Doris Java files. Add the Apache license header to align with repository conventions/compliance.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/exception/StreamLoadException.java:
##########
@@ -0,0 +1,16 @@
+package org.apache.doris.sdk.load.exception;
+
+/**
Review Comment:
This new source file is missing the standard ASF license header comment block that appears at the top of other Doris Java files. Add the Apache license header to align with repository conventions/compliance.
##########
sdk/java-doris-sdk/src/test/java/org/apache/doris/sdk/load/DorisLoadClientTest.java:
##########
@@ -0,0 +1,112 @@
+package org.apache.doris.sdk.load;
+
+import org.apache.doris.sdk.load.config.*;
Review Comment:
This new test file is missing the standard ASF license header comment block used across Doris Java sources/tests. Add the Apache license header for consistency/compliance.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/DorisLoadClient.java:
##########
@@ -0,0 +1,206 @@
+package org.apache.doris.sdk.load;
+
+import org.apache.doris.sdk.load.config.DorisConfig;
+import org.apache.doris.sdk.load.exception.StreamLoadException;
+import org.apache.doris.sdk.load.internal.RequestBuilder;
+import org.apache.doris.sdk.load.internal.StreamLoader;
+import org.apache.doris.sdk.load.model.LoadResponse;
+import org.apache.http.client.methods.HttpPut;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.zip.GZIPOutputStream;
+
+/**
+ * Thread-safe Doris stream load client.
+ *
+ * <p>Usage:
+ * <pre>
+ * DorisLoadClient client = new DorisLoadClient(config);
+ * LoadResponse resp = client.load(new ByteArrayInputStream(data));
+ * if (resp.getStatus() == LoadResponse.Status.SUCCESS) { ... }
+ * </pre>
+ *
+ * <p>Thread safety: this instance can be shared across threads.
+ * Each {@link #load} call must receive an independent InputStream.
+ */
+public class DorisLoadClient implements AutoCloseable {
+
+ private static final Logger log = LoggerFactory.getLogger(DorisLoadClient.class);
+ /** Absolute maximum for a single backoff interval: 5 minutes. */
+ private static final long ABSOLUTE_MAX_INTERVAL_MS = 300_000L;
+
+ private final DorisConfig config;
+ private final StreamLoader streamLoader;
+
+ public DorisLoadClient(DorisConfig config) {
+ this.config = config;
+ this.streamLoader = new StreamLoader();
+ }
+
+ /** Package-private constructor for testing with a mock StreamLoader. */
+ DorisLoadClient(DorisConfig config, StreamLoader streamLoader) {
+ this.config = config;
+ this.streamLoader = streamLoader;
+ }
+
+ /**
+ * Loads data from the given InputStream into Doris via stream load.
+ * The InputStream is fully consumed and buffered before the first attempt.
+ * Retries with exponential backoff on retryable errors (network/HTTP failures).
+ * Business failures (bad data, schema mismatch, auth) are returned immediately without retry.
+ *
+ * @param inputStream data to load (consumed once; must not be shared across threads)
+ * @return LoadResponse with status SUCCESS or FAILURE
+ * @throws IOException if the stream cannot be read or all retries are exhausted
+ */
+ public LoadResponse load(InputStream inputStream) throws IOException {
+ int maxRetries = 6;
+ long baseIntervalMs = 1000L;
+ long maxTotalTimeMs = 60000L;
+
+ if (config.getRetry() != null) {
+ maxRetries = config.getRetry().getMaxRetryTimes();
+ baseIntervalMs = config.getRetry().getBaseIntervalMs();
+ maxTotalTimeMs = config.getRetry().getMaxTotalTimeMs();
+ }
+
+ log.info("Starting stream load: {}.{}", config.getDatabase(), config.getTable());
+
+ // Buffer the InputStream once so retries can replay the body
+ byte[] bodyData = readAll(inputStream);
+
+ // Compress once before the retry loop (avoids re-compressing on each retry)
+ if (config.isEnableGzip()) {
+ bodyData = gzipCompress(bodyData);
+ }
+ Exception lastException = null;
+ LoadResponse lastResponse = null;
+ long totalRetryTimeMs = 0L;
+ long operationStart = System.currentTimeMillis();
+
+ for (int attempt = 0; attempt <= maxRetries; attempt++) {
+ if (attempt > 0) {
+ log.info("Retry attempt {}/{}", attempt, maxRetries);
+ long backoff = calculateBackoffMs(attempt, baseIntervalMs, maxTotalTimeMs, totalRetryTimeMs);
+
+ if (maxTotalTimeMs > 0 && totalRetryTimeMs + backoff > maxTotalTimeMs) {
+ log.warn("Next retry backoff ({}ms) would exceed total limit ({}ms). Stopping.", backoff, maxTotalTimeMs);
+ break;
+ }
+
+ log.info("Waiting {}ms before retry (total retry time so far: {}ms)", backoff, totalRetryTimeMs);
+ sleep(backoff);
+ totalRetryTimeMs += backoff;
+ } else {
+ log.info("Initial load attempt");
+ }
+
+ try {
+ HttpPut request = RequestBuilder.build(config, bodyData, attempt);
+ lastResponse = streamLoader.execute(request);
+
+ if (lastResponse.getStatus() == LoadResponse.Status.SUCCESS) {
+ log.info("Stream load succeeded on attempt {}", attempt + 1);
+ return lastResponse;
+ }
+
+ // Business failure (bad data, schema mismatch, auth) — do not retry
+ log.error("Load failed (non-retryable): {}", lastResponse.getErrorMessage());
+ return lastResponse;
+
+ } catch (StreamLoadException e) {
+ // Retryable: network error, HTTP 5xx, etc.
+ lastException = e;
+ log.error("Attempt {} failed with retryable error: ", attempt + 1, e);
+ } catch (Exception e) {
+ // Wrap unexpected exceptions as retryable
+ lastException = new StreamLoadException("Unexpected error building request: " + e.getMessage(), e);
+ log.error("Attempt {} failed with unexpected error: {}", attempt + 1, e.getMessage());
+
+ if (attempt == maxRetries) {
+ log.warn("Reached maximum retry attempts ({}), stopping.", maxRetries);
+ break;
+ }
+
+ // Check elapsed wall-clock time
+ long elapsed = System.currentTimeMillis() - operationStart;
+ if (maxTotalTimeMs > 0 && elapsed > maxTotalTimeMs) {
+ log.warn("Total elapsed time ({}ms) exceeded limit ({}ms), stopping retries.", elapsed, maxTotalTimeMs);
+ break;
+ }
+ }
Review Comment:
Retry time limiting is inconsistent: the wall-clock `elapsed > maxTotalTimeMs` check is only applied in the generic `Exception` catch, not in the `StreamLoadException` (retryable) path. With repeated network/HTTP failures, retries can continue well beyond `maxTotalTimeMs`, and `calculateBackoffMs()` can also return 0 which may cause a tight retry loop. Apply the same elapsed/remaining-time stop condition for `StreamLoadException` retries (and stop when computed backoff is 0 due to no remaining time).
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/internal/StreamLoader.java:
##########
@@ -0,0 +1,135 @@
+package org.apache.doris.sdk.load.internal;
+
+import org.apache.doris.sdk.load.exception.StreamLoadException;
Review Comment:
This new source file is missing the standard ASF license header comment block that appears at the top of other Doris Java files. Add the Apache license header to align with repository conventions/compliance.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/internal/RequestBuilder.java:
##########
@@ -0,0 +1,144 @@
+package org.apache.doris.sdk.load.internal;
+
+import org.apache.doris.sdk.load.config.DorisConfig;
+import org.apache.doris.sdk.load.config.GroupCommitMode;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.entity.ByteArrayEntity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.UUID;
+
+/**
+ * Builds HttpPut requests for Doris stream load.
+ * Handles header assembly, label generation, and group commit logic.
+ */
+public class RequestBuilder {
+
+ private static final Logger log = LoggerFactory.getLogger(RequestBuilder.class);
+ private static final String STREAM_LOAD_PATTERN = "http://%s/api/%s/%s/_stream_load";
+ private static final Random RANDOM = new Random();
+
+ /**
+ * Builds an HttpPut request for the given config and data.
+ *
+ * @param config DorisConfig
+ * @param data pre-buffered (and optionally pre-compressed) request body bytes
+ * @param attempt 0 = first attempt, >0 = retry number
+ */
+ public static HttpPut build(DorisConfig config, byte[] data, int attempt) throws Exception {
+ String host = pickEndpoint(config.getEndpoints());
+ String url = String.format(STREAM_LOAD_PATTERN, host, config.getDatabase(), config.getTable());
+
Review Comment:
`STREAM_LOAD_PATTERN` hard-codes the `http://` scheme, while `pickEndpoint()` strips both `http://` and `https://`. As a result, configuring an `https://...` endpoint will still produce an `http://...` request URL. Preserve the original endpoint scheme when building the URI (e.g., keep full endpoint as base URL and append `/api/<db>/<table>/_stream_load`).
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/examples/SimpleConfigExample.java:
##########
@@ -0,0 +1,81 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.sdk.examples;
+
+import org.apache.doris.sdk.DorisClient;
+import org.apache.doris.sdk.load.DorisLoadClient;
+import org.apache.doris.sdk.load.config.DorisConfig;
+import org.apache.doris.sdk.load.config.GroupCommitMode;
+import org.apache.doris.sdk.load.model.LoadResponse;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Simple configuration example — basic JSON Lines load with Group Commit ASYNC.
+ * Mirrors Go SDK's SimpleConfigExample.
+ */
+public class SimpleConfigExample {
+
+ public static void run() {
+ Map<String, String> options = new HashMap<>();
+ options.put("strict_mode", "true");
+ options.put("max_filter_ratio", "0.1");
+
+ DorisConfig config = DorisConfig.builder()
+ .endpoints(Arrays.asList("http://10.16.10.6:38535"))
Review Comment:
This example hard-codes a private/internal endpoint IP (`http://10.16.10.6:38535`). In an Apache repo, examples should use placeholders (e.g., `http://127.0.0.1:8030` or `http://fe-host:8030`) to avoid leaking internal network details and to make the sample copy/paste friendly.
```suggestion
.endpoints(Arrays.asList("http://127.0.0.1:8030"))
```
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/model/RespContent.java:
##########
@@ -0,0 +1,75 @@
+package org.apache.doris.sdk.load.model;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
Review Comment:
This new source file is missing the standard ASF license header comment block that appears at the top of other Doris Java files. Add the Apache license header to align with repository conventions/compliance.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/examples/JsonExample.java:
##########
@@ -0,0 +1,97 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.sdk.examples;
+
+import org.apache.doris.sdk.DorisClient;
+import org.apache.doris.sdk.load.DorisLoadClient;
+import org.apache.doris.sdk.load.config.DorisConfig;
+import org.apache.doris.sdk.load.config.GroupCommitMode;
+import org.apache.doris.sdk.load.config.JsonFormat;
+import org.apache.doris.sdk.load.config.RetryConfig;
+import org.apache.doris.sdk.load.model.LoadResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Arrays;
+
+/**
+ * Production-level JSON data loading demo.
+ * Loads 50,000 JSON Lines order records in a single stream load call.
+ * Mirrors Go SDK's RunJSONExample.
+ */
+public class JsonExample {
+
+ private static final Logger log = LoggerFactory.getLogger(JsonExample.class);
+ private static final int JSON_BATCH_SIZE = 50_000;
+
+ public static void run() {
+ System.out.println("=== Production-Level JSON Data Loading Demo ===");
+ log.info("Starting JSON loading demo with {} order records", JSON_BATCH_SIZE);
+
+ DorisConfig config = DorisConfig.builder()
+ .endpoints(Arrays.asList("http://10.16.10.6:38535"))
Review Comment:
This example hard-codes a private/internal endpoint IP (`http://10.16.10.6:38535`). In an Apache repo, examples should use placeholders (e.g., `http://127.0.0.1:8030` or `http://fe-host:8030`) to avoid leaking internal network details and to make the sample copy/paste friendly.
```suggestion
.endpoints(Arrays.asList("http://127.0.0.1:8030"))
```
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/config/RetryConfig.java:
##########
@@ -0,0 +1,49 @@
+package org.apache.doris.sdk.load.config;
+
+/**
Review Comment:
This new source file is missing the standard ASF license header comment block that appears at the top of other Doris Java files. Add the Apache license header to align with repository conventions/compliance.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/examples/GzipExample.java:
##########
@@ -0,0 +1,79 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.sdk.examples;
+
+import org.apache.doris.sdk.DorisClient;
+import org.apache.doris.sdk.load.DorisLoadClient;
+import org.apache.doris.sdk.load.config.DorisConfig;
+import org.apache.doris.sdk.load.config.GroupCommitMode;
+import org.apache.doris.sdk.load.model.LoadResponse;
+
+import java.util.Arrays;
+
+/**
+ * Gzip compression example.
+ * The SDK compresses the request body transparently before sending.
+ * No need to pre-compress the data — just set enableGzip(true).
+ * Mirrors Go SDK's GzipExample.
+ */
+public class GzipExample {
+
+ public static void run() {
+ DorisConfig config = DorisConfig.builder()
+ .endpoints(Arrays.asList("http://10.16.10.6:38535"))
Review Comment:
This example hard-codes a private/internal endpoint IP (`http://10.16.10.6:38535`). In an Apache repo, examples should use placeholders (e.g., `http://127.0.0.1:8030` or `http://fe-host:8030`) to avoid leaking internal network details and to make the sample copy/paste friendly.
```suggestion
.endpoints(Arrays.asList("http://127.0.0.1:8030"))
```
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/internal/StreamLoader.java:
##########
@@ -0,0 +1,135 @@
+package org.apache.doris.sdk.load.internal;
+
+import org.apache.doris.sdk.load.exception.StreamLoadException;
+import org.apache.doris.sdk.load.model.LoadResponse;
+import org.apache.doris.sdk.load.model.RespContent;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.conn.ssl.NoopHostnameVerifier;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.DefaultRedirectStrategy;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.ssl.SSLContextBuilder;
+import org.apache.http.util.EntityUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * Executes a single HTTP PUT request and parses the Doris response.
+ * Thread-safe: CloseableHttpClient is shared and reused across calls.
+ *
+ * Uses LaxRedirectStrategy so that 307 redirects on PUT requests are
+ * followed automatically (Doris FE redirects stream load to BE).
+ */
+public class StreamLoader implements AutoCloseable {
+
+ private static final Logger log = LoggerFactory.getLogger(StreamLoader.class);
+ private static final int SOCKET_TIMEOUT_MS = 9 * 60 * 1000;
+ private static final int CONNECT_TIMEOUT_MS = 60_000;
+
+ private final HttpClientBuilder httpClientBuilder;
+ private final ObjectMapper objectMapper;
+
+ public StreamLoader() {
+ this.httpClientBuilder = buildHttpClient();
+ this.objectMapper = new ObjectMapper();
+ }
+
+ /** Package-private constructor for testing with a mock HTTP client. */
+ StreamLoader(HttpClientBuilder httpClientBuilder) {
+ this.httpClientBuilder = httpClientBuilder;
+ this.objectMapper = new ObjectMapper();
+ }
+
+ /**
+ * Executes the HTTP PUT request and returns a LoadResponse.
+ *
+ * @throws StreamLoadException for retryable HTTP-level errors (non-200 status, connection failure)
+ * @throws IOException for unrecoverable I/O errors
+ */
+ public LoadResponse execute(HttpPut request) throws IOException {
+ log.debug("Sending HTTP PUT to {}", request.getURI());
+ long start = System.currentTimeMillis();
+
+ try (CloseableHttpClient httpClient = httpClientBuilder.build();
+ CloseableHttpResponse response = httpClient.execute(request)) {
+ int statusCode = response.getStatusLine().getStatusCode();
+ log.debug("HTTP response status: {}", statusCode);
+ log.debug("HTTP request completed in {} ms", System.currentTimeMillis() - start);
+
+ if (statusCode == 200) {
+ return parseResponse(response);
+ } else {
+ // Non-200 is retryable (e.g. 503, 429)
+ throw new StreamLoadException("stream load error: " + response.getStatusLine().toString());
+ }
+ } catch (StreamLoadException e) {
+ throw e;
+ } catch (IOException e) {
+ throw new StreamLoadException("stream load request failed: " + e.getMessage(), e);
+ }
+ }
+
+ private LoadResponse parseResponse(CloseableHttpResponse response) throws IOException {
+ byte[] bodyBytes = EntityUtils.toByteArray(response.getEntity());
+ String body = new String(bodyBytes, StandardCharsets.UTF_8);
+ log.info("Stream Load Response: {}", body);
+
+ RespContent resp = objectMapper.readValue(body, RespContent.class);
+
+ if (isSuccess(resp.getStatus())) {
+ log.info("Load operation completed successfully");
+ return LoadResponse.success(resp);
+ } else {
+ log.error("Load operation failed with status: {}", resp.getStatus());
+ String errorMsg;
+ if (resp.getMessage() != null && !resp.getMessage().isEmpty()) {
+ errorMsg = "load failed. cause by: " + resp.getMessage()
+ + ", please check more detail from url: " + resp.getErrorUrl();
+ } else {
+ errorMsg = body;
+ }
+ return LoadResponse.failure(resp, errorMsg);
+ }
+ }
+
+ private static boolean isSuccess(String status) {
+ return "success".equalsIgnoreCase(status);
+ }
+
+ private static HttpClientBuilder buildHttpClient() {
+ try {
+ RequestConfig requestConfig = RequestConfig.custom()
+ .setConnectTimeout(CONNECT_TIMEOUT_MS)
+ .setSocketTimeout(SOCKET_TIMEOUT_MS)
+ .setConnectionRequestTimeout(CONNECT_TIMEOUT_MS)
+ .build();
+
+ return HttpClientBuilder.create()
+ .setDefaultRequestConfig(requestConfig)
+ .setRedirectStrategy(new DefaultRedirectStrategy() {
+ @Override
+ protected boolean isRedirectable(String method) {
+ return true;
+ }
+ })
+ .setSSLSocketFactory(
+ new SSLConnectionSocketFactory(
+ SSLContextBuilder.create()
+ .loadTrustMaterial(null, (chain, authType) -> true)
+ .build(),
+ NoopHostnameVerifier.INSTANCE));
Review Comment:
The HTTP client is configured to trust all TLS certificates and disable hostname verification (`loadTrustMaterial(... -> true)` + `NoopHostnameVerifier`). This makes HTTPS connections vulnerable to MITM and should not be the default in a production SDK. Use the default SSLContext/hostname verifier (or make an explicit, opt-in 'insecureSkipVerify' config only for testing).
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/DorisLoadClient.java:
##########
@@ -0,0 +1,206 @@
+package org.apache.doris.sdk.load;
+
+import org.apache.doris.sdk.load.config.DorisConfig;
Review Comment:
This new source file is missing the standard ASF license header comment block that appears at the top of other Doris Java files. Add the Apache license header to align with repository conventions/compliance.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/examples/ConcurrentExample.java:
##########
@@ -0,0 +1,190 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.sdk.examples;
+
+import org.apache.doris.sdk.DorisClient;
+import org.apache.doris.sdk.load.DorisLoadClient;
+import org.apache.doris.sdk.load.config.DorisConfig;
+import org.apache.doris.sdk.load.config.GroupCommitMode;
+import org.apache.doris.sdk.load.config.RetryConfig;
+import org.apache.doris.sdk.load.model.LoadResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.atomic.AtomicLong;
+
+/**
+ * Production-level concurrent large-scale data loading demo.
+ * Loads 1,000,000 records using 10 concurrent threads, each loading 100,000 records.
+ *
+ * <p>Thread safety: DorisLoadClient is shared across all workers.
+ * Each worker uses its own independent InputStream — never share streams across threads.
+ *
+ * Mirrors Go SDK's RunConcurrentExample.
+ */
+public class ConcurrentExample {
+
+ private static final Logger log = LoggerFactory.getLogger(ConcurrentExample.class);
+
+ private static final int TOTAL_RECORDS = 1_000_000;
+ private static final int NUM_WORKERS = 10;
+ private static final int RECORDS_PER_WORKER = TOTAL_RECORDS / NUM_WORKERS;
+
+ /** Per-worker result. */
+ static class WorkerResult {
+ final int workerId;
+ final boolean success;
+ final int recordsLoaded;
+ final long dataSizeBytes;
+ final long loadTimeMs;
+ final String error;
+
+ WorkerResult(int workerId, boolean success, int recordsLoaded,
+ long dataSizeBytes, long loadTimeMs, String error) {
+ this.workerId = workerId;
+ this.success = success;
+ this.recordsLoaded = recordsLoaded;
+ this.dataSizeBytes = dataSizeBytes;
+ this.loadTimeMs = loadTimeMs;
+ this.error = error;
+ }
+ }
+
+ public static void run() {
+ System.out.println("=== Production-Level Concurrent Large-Scale Loading Demo ===");
+ System.out.printf("Scale: %d total records, %d workers, %d records per worker%n",
+ TOTAL_RECORDS, NUM_WORKERS, RECORDS_PER_WORKER);
+
+ // Single shared client — thread-safe
+ DorisConfig config = DorisConfig.builder()
+ .endpoints(Arrays.asList("http://10.16.10.6:38535"))
Review Comment:
This example hard-codes a private/internal endpoint IP (`http://10.16.10.6:38535`). In an Apache repo, examples should use placeholders (e.g., `http://127.0.0.1:8030` or `http://fe-host:8030`) to avoid leaking internal network details and to make the sample copy/paste friendly.
```suggestion
.endpoints(Arrays.asList("http://127.0.0.1:8030"))
```
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/config/JsonFormat.java:
##########
@@ -0,0 +1,46 @@
+package org.apache.doris.sdk.load.config;
+
+import java.util.HashMap;
Review Comment:
This new source file is missing the standard ASF license header comment block that appears at the top of other Doris Java files. Add the Apache license header to align with repository conventions/compliance.
##########
sdk/java-doris-sdk/src/test/java/org/apache/doris/sdk/load/internal/RequestBuilderTest.java:
##########
@@ -0,0 +1,96 @@
+package org.apache.doris.sdk.load.internal;
+
+import org.apache.doris.sdk.load.config.*;
Review Comment:
This new test file is missing the standard ASF license header comment block used across Doris Java sources/tests. Add the Apache license header for consistency/compliance.
##########
sdk/java-doris-sdk/src/test/java/org/apache/doris/sdk/load/config/DorisConfigTest.java:
##########
@@ -0,0 +1,83 @@
+package org.apache.doris.sdk.load.config;
+
+import org.junit.Test;
Review Comment:
This new test file is missing the standard ASF license header comment block used across Doris Java sources/tests. Add the Apache license header for consistency/compliance.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/examples/SingleBatchExample.java:
##########
@@ -0,0 +1,91 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.sdk.examples;
+
+import org.apache.doris.sdk.DorisClient;
+import org.apache.doris.sdk.load.DorisLoadClient;
+import org.apache.doris.sdk.load.config.DorisConfig;
+import org.apache.doris.sdk.load.config.GroupCommitMode;
+import org.apache.doris.sdk.load.config.RetryConfig;
+import org.apache.doris.sdk.load.model.LoadResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Arrays;
+
+/**
+ * Production-level single-threaded large batch loading demo.
+ * Loads 100,000 CSV order records in a single stream load call.
+ * Mirrors Go SDK's RunSingleBatchExample.
+ */
+public class SingleBatchExample {
+
+ private static final Logger log = LoggerFactory.getLogger(SingleBatchExample.class);
+ private static final int BATCH_SIZE = 100_000;
+
+ public static void run() {
+ System.out.println("=== Production-Level Large Batch Loading Demo ===");
+ log.info("Starting large batch loading demo with {} order records", BATCH_SIZE);
+
+ DorisConfig config = DorisConfig.builder()
+ .endpoints(Arrays.asList("http://10.16.10.6:38535"))
Review Comment:
This example hard-codes a private/internal endpoint IP (`http://10.16.10.6:38535`). In an Apache repo, examples should use placeholders (e.g., `http://127.0.0.1:8030` or `http://fe-host:8030`) to avoid leaking internal network details and to make the sample copy/paste friendly.
```suggestion
.endpoints(Arrays.asList("http://127.0.0.1:8030"))
```
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/internal/RequestBuilder.java:
##########
@@ -0,0 +1,144 @@
+package org.apache.doris.sdk.load.internal;
+
+import org.apache.doris.sdk.load.config.DorisConfig;
Review Comment:
This new source file is missing the standard ASF license header comment block that appears at the top of other Doris Java files. Add the Apache license header to align with repository conventions/compliance.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/model/LoadResponse.java:
##########
@@ -0,0 +1,39 @@
+package org.apache.doris.sdk.load.model;
+
+/**
Review Comment:
This new source file is missing the standard ASF license header comment block that appears at the top of other Doris Java files. Add the Apache license header to align with repository conventions/compliance.
##########
sdk/java-doris-sdk/src/test/java/org/apache/doris/sdk/load/model/LoadResponseTest.java:
##########
@@ -0,0 +1,61 @@
+package org.apache.doris.sdk.load.model;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
Review Comment:
This new test file is missing the standard ASF license header comment block used across Doris Java sources/tests. Add the Apache license header for consistency/compliance.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Enhancement](sdk) Add java SDK as a subproject under sdk/java-doris-sdk [doris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #61626:
URL: https://github.com/apache/doris/pull/61626#issuecomment-4115763608
PR approved by at least one committer and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Enhancement](sdk) Add java SDK as a subproject under sdk/java-doris-sdk [doris]
Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba commented on PR #61626:
URL: https://github.com/apache/doris/pull/61626#issuecomment-4115127946
run buildall
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Enhancement](sdk) Add java SDK as a subproject under sdk/java-doris-sdk [doris]
Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba commented on PR #61626:
URL: https://github.com/apache/doris/pull/61626#issuecomment-4108844820
/review
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Enhancement](sdk) Add java SDK as a subproject under sdk/java-doris-sdk [doris]
Posted by "CalvinKirs (via GitHub)" <gi...@apache.org>.
CalvinKirs commented on code in PR #61626:
URL: https://github.com/apache/doris/pull/61626#discussion_r2978798530
##########
sdk/java-doris-sdk/pom.xml:
##########
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.doris</groupId>
+ <artifactId>java-doris-sdk</artifactId>
+ <version>1.0.0</version>
+ <packaging>jar</packaging>
+
+ <name>Apache Doris Java SDK</name>
+ <description>A lightweight Apache Doris Stream Load client (Java version)</description>
+
+ <properties>
+ <maven.compiler.source>8</maven.compiler.source>
+ <maven.compiler.target>8</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <!-- HTTP client -->
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.5.13</version>
+ </dependency>
+
+ <!-- JSON serialization -->
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>2.13.5</version>
+ </dependency>
+
+ <!-- Logging facade -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.7.9</version>
+ </dependency>
+
+ <!-- Test: JUnit + Mockito -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.13.2</version>
+ <scope>test</scope>
Review Comment:
5?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Enhancement](sdk) Add java SDK as a subproject under sdk/java-doris-sdk [doris]
Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba merged PR #61626:
URL: https://github.com/apache/doris/pull/61626
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Enhancement](sdk) Add java SDK as a subproject under sdk/java-doris-sdk [doris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #61626:
URL: https://github.com/apache/doris/pull/61626#discussion_r2973590744
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/internal/StreamLoader.java:
##########
@@ -0,0 +1,135 @@
+package org.apache.doris.sdk.load.internal;
+
+import org.apache.doris.sdk.load.exception.StreamLoadException;
+import org.apache.doris.sdk.load.model.LoadResponse;
+import org.apache.doris.sdk.load.model.RespContent;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.conn.ssl.NoopHostnameVerifier;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.DefaultRedirectStrategy;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.ssl.SSLContextBuilder;
+import org.apache.http.util.EntityUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * Executes a single HTTP PUT request and parses the Doris response.
+ * Thread-safe: CloseableHttpClient is shared and reused across calls.
+ *
+ * Uses LaxRedirectStrategy so that 307 redirects on PUT requests are
+ * followed automatically (Doris FE redirects stream load to BE).
+ */
+public class StreamLoader implements AutoCloseable {
+
+ private static final Logger log = LoggerFactory.getLogger(StreamLoader.class);
+ private static final int SOCKET_TIMEOUT_MS = 9 * 60 * 1000;
+ private static final int CONNECT_TIMEOUT_MS = 60_000;
+
+ private final HttpClientBuilder httpClientBuilder;
+ private final ObjectMapper objectMapper;
+
+ public StreamLoader() {
+ this.httpClientBuilder = buildHttpClient();
+ this.objectMapper = new ObjectMapper();
+ }
+
+ /** Package-private constructor for testing with a mock HTTP client. */
+ StreamLoader(HttpClientBuilder httpClientBuilder) {
+ this.httpClientBuilder = httpClientBuilder;
+ this.objectMapper = new ObjectMapper();
+ }
+
+ /**
+ * Executes the HTTP PUT request and returns a LoadResponse.
+ *
+ * @throws StreamLoadException for retryable HTTP-level errors (non-200 status, connection failure)
+ * @throws IOException for unrecoverable I/O errors
+ */
+ public LoadResponse execute(HttpPut request) throws IOException {
+ log.debug("Sending HTTP PUT to {}", request.getURI());
+ long start = System.currentTimeMillis();
+
+ try (CloseableHttpClient httpClient = httpClientBuilder.build();
+ CloseableHttpResponse response = httpClient.execute(request)) {
+ int statusCode = response.getStatusLine().getStatusCode();
+ log.debug("HTTP response status: {}", statusCode);
+ log.debug("HTTP request completed in {} ms", System.currentTimeMillis() - start);
+
+ if (statusCode == 200) {
+ return parseResponse(response);
+ } else {
+ // Non-200 is retryable (e.g. 503, 429)
+ throw new StreamLoadException("stream load error: " + response.getStatusLine().toString());
+ }
+ } catch (StreamLoadException e) {
+ throw e;
+ } catch (IOException e) {
+ throw new StreamLoadException("stream load request failed: " + e.getMessage(), e);
+ }
+ }
+
+ private LoadResponse parseResponse(CloseableHttpResponse response) throws IOException {
+ byte[] bodyBytes = EntityUtils.toByteArray(response.getEntity());
+ String body = new String(bodyBytes, StandardCharsets.UTF_8);
+ log.info("Stream Load Response: {}", body);
+
+ RespContent resp = objectMapper.readValue(body, RespContent.class);
+
+ if (isSuccess(resp.getStatus())) {
+ log.info("Load operation completed successfully");
+ return LoadResponse.success(resp);
+ } else {
+ log.error("Load operation failed with status: {}", resp.getStatus());
+ String errorMsg;
+ if (resp.getMessage() != null && !resp.getMessage().isEmpty()) {
+ errorMsg = "load failed. cause by: " + resp.getMessage()
+ + ", please check more detail from url: " + resp.getErrorUrl();
+ } else {
+ errorMsg = body;
+ }
+ return LoadResponse.failure(resp, errorMsg);
+ }
+ }
+
+ private static boolean isSuccess(String status) {
+ return "success".equalsIgnoreCase(status);
+ }
+
+ private static HttpClientBuilder buildHttpClient() {
+ try {
+ RequestConfig requestConfig = RequestConfig.custom()
+ .setConnectTimeout(CONNECT_TIMEOUT_MS)
+ .setSocketTimeout(SOCKET_TIMEOUT_MS)
+ .setConnectionRequestTimeout(CONNECT_TIMEOUT_MS)
+ .build();
+
+ return HttpClientBuilder.create()
+ .setDefaultRequestConfig(requestConfig)
+ .setRedirectStrategy(new DefaultRedirectStrategy() {
+ @Override
+ protected boolean isRedirectable(String method) {
+ return true;
+ }
+ })
+ .setSSLSocketFactory(
+ new SSLConnectionSocketFactory(
+ SSLContextBuilder.create()
+ .loadTrustMaterial(null, (chain, authType) -> true)
+ .build(),
+ NoopHostnameVerifier.INSTANCE));
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to build HTTP client", e);
+ }
+ }
+
+ @Override
+ public void close() throws IOException {
+ }
Review Comment:
**[Bug]** `close()` is a no-op, but `DorisLoadClient.close()` delegates to `streamLoader.close()`. Once the HTTP client is stored as a field (per the comment above), this method must close it. As-is, if anyone uses the `try-with-resources` pattern shown in the examples and README, no resources are actually released.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/DorisLoadClient.java:
##########
@@ -0,0 +1,206 @@
+package org.apache.doris.sdk.load;
+
+import org.apache.doris.sdk.load.config.DorisConfig;
+import org.apache.doris.sdk.load.exception.StreamLoadException;
+import org.apache.doris.sdk.load.internal.RequestBuilder;
+import org.apache.doris.sdk.load.internal.StreamLoader;
+import org.apache.doris.sdk.load.model.LoadResponse;
+import org.apache.http.client.methods.HttpPut;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.zip.GZIPOutputStream;
+
+/**
+ * Thread-safe Doris stream load client.
+ *
+ * <p>Usage:
+ * <pre>
+ * DorisLoadClient client = new DorisLoadClient(config);
+ * LoadResponse resp = client.load(new ByteArrayInputStream(data));
+ * if (resp.getStatus() == LoadResponse.Status.SUCCESS) { ... }
+ * </pre>
+ *
+ * <p>Thread safety: this instance can be shared across threads.
+ * Each {@link #load} call must receive an independent InputStream.
+ */
+public class DorisLoadClient implements AutoCloseable {
+
+ private static final Logger log = LoggerFactory.getLogger(DorisLoadClient.class);
+ /** Absolute maximum for a single backoff interval: 5 minutes. */
+ private static final long ABSOLUTE_MAX_INTERVAL_MS = 300_000L;
+
+ private final DorisConfig config;
+ private final StreamLoader streamLoader;
+
+ public DorisLoadClient(DorisConfig config) {
+ this.config = config;
+ this.streamLoader = new StreamLoader();
+ }
+
+ /** Package-private constructor for testing with a mock StreamLoader. */
+ DorisLoadClient(DorisConfig config, StreamLoader streamLoader) {
+ this.config = config;
+ this.streamLoader = streamLoader;
+ }
+
+ /**
+ * Loads data from the given InputStream into Doris via stream load.
+ * The InputStream is fully consumed and buffered before the first attempt.
+ * Retries with exponential backoff on retryable errors (network/HTTP failures).
+ * Business failures (bad data, schema mismatch, auth) are returned immediately without retry.
+ *
+ * @param inputStream data to load (consumed once; must not be shared across threads)
+ * @return LoadResponse with status SUCCESS or FAILURE
+ * @throws IOException if the stream cannot be read or all retries are exhausted
+ */
+ public LoadResponse load(InputStream inputStream) throws IOException {
+ int maxRetries = 6;
+ long baseIntervalMs = 1000L;
+ long maxTotalTimeMs = 60000L;
+
+ if (config.getRetry() != null) {
+ maxRetries = config.getRetry().getMaxRetryTimes();
+ baseIntervalMs = config.getRetry().getBaseIntervalMs();
+ maxTotalTimeMs = config.getRetry().getMaxTotalTimeMs();
+ }
+
+ log.info("Starting stream load: {}.{}", config.getDatabase(), config.getTable());
+
+ // Buffer the InputStream once so retries can replay the body
+ byte[] bodyData = readAll(inputStream);
+
+ // Compress once before the retry loop (avoids re-compressing on each retry)
+ if (config.isEnableGzip()) {
+ bodyData = gzipCompress(bodyData);
+ }
+ Exception lastException = null;
+ LoadResponse lastResponse = null;
+ long totalRetryTimeMs = 0L;
+ long operationStart = System.currentTimeMillis();
+
+ for (int attempt = 0; attempt <= maxRetries; attempt++) {
+ if (attempt > 0) {
Review Comment:
**[Bug] Retry timeout enforcement is asymmetric and uses sleep-time instead of wall-clock time.**
`totalRetryTimeMs` (line 82) only accumulates sleep/backoff time. Actual HTTP request execution time is never accounted for. This means:
- If `maxTotalTimeMs = 60s` and each request takes 30s before throwing `StreamLoadException`, 7 attempts could take ~273s total (210s of request time + 63s of sleep), but `totalRetryTimeMs` would only show ~63s.
Additionally, the `StreamLoadException` catch block (line 115) has no wall-clock time check, while the generic `Exception` catch block (line 119) does check `System.currentTimeMillis() - operationStart`. This asymmetry means `StreamLoadException` retries can run indefinitely beyond the time limit.
**Fix**: Replace `totalRetryTimeMs` tracking with wall-clock elapsed time, and apply the same timeout check uniformly in both catch blocks:
```java
long elapsed = System.currentTimeMillis() - operationStart;
if (maxTotalTimeMs > 0 && elapsed > maxTotalTimeMs) {
log.warn("Total elapsed time exceeded limit, stopping retries.");
break;
}
```
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/internal/StreamLoader.java:
##########
@@ -0,0 +1,135 @@
+package org.apache.doris.sdk.load.internal;
+
+import org.apache.doris.sdk.load.exception.StreamLoadException;
+import org.apache.doris.sdk.load.model.LoadResponse;
+import org.apache.doris.sdk.load.model.RespContent;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.conn.ssl.NoopHostnameVerifier;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.DefaultRedirectStrategy;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.ssl.SSLContextBuilder;
+import org.apache.http.util.EntityUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * Executes a single HTTP PUT request and parses the Doris response.
+ * Thread-safe: CloseableHttpClient is shared and reused across calls.
+ *
+ * Uses LaxRedirectStrategy so that 307 redirects on PUT requests are
+ * followed automatically (Doris FE redirects stream load to BE).
+ */
+public class StreamLoader implements AutoCloseable {
+
+ private static final Logger log = LoggerFactory.getLogger(StreamLoader.class);
+ private static final int SOCKET_TIMEOUT_MS = 9 * 60 * 1000;
+ private static final int CONNECT_TIMEOUT_MS = 60_000;
+
+ private final HttpClientBuilder httpClientBuilder;
+ private final ObjectMapper objectMapper;
+
+ public StreamLoader() {
+ this.httpClientBuilder = buildHttpClient();
+ this.objectMapper = new ObjectMapper();
+ }
+
+ /** Package-private constructor for testing with a mock HTTP client. */
+ StreamLoader(HttpClientBuilder httpClientBuilder) {
+ this.httpClientBuilder = httpClientBuilder;
+ this.objectMapper = new ObjectMapper();
+ }
+
+ /**
+ * Executes the HTTP PUT request and returns a LoadResponse.
+ *
+ * @throws StreamLoadException for retryable HTTP-level errors (non-200 status, connection failure)
+ * @throws IOException for unrecoverable I/O errors
+ */
+ public LoadResponse execute(HttpPut request) throws IOException {
+ log.debug("Sending HTTP PUT to {}", request.getURI());
+ long start = System.currentTimeMillis();
+
+ try (CloseableHttpClient httpClient = httpClientBuilder.build();
+ CloseableHttpResponse response = httpClient.execute(request)) {
Review Comment:
**[Performance Bug]** A new `CloseableHttpClient` is created on every `execute()` call via `httpClientBuilder.build()`. This is a significant performance anti-pattern:
1. Each `build()` creates a new connection manager, SSL context, and connection pool.
2. Connection reuse (HTTP keep-alive) across calls is impossible since the client is immediately closed.
3. For a single `load()` with retries (up to 7 attempts), this creates and destroys 7 separate HTTP clients.
The Javadoc at line 24 claims *"Thread-safe: CloseableHttpClient is shared and reused across calls"* — this is incorrect; neither sharing nor reuse happens.
**Fix**: Build the `CloseableHttpClient` once in the constructor, store it as a field, reuse it in `execute()`, and close it in `close()`:
```java
private final CloseableHttpClient httpClient;
public StreamLoader() {
this.httpClient = buildHttpClient().build();
this.objectMapper = new ObjectMapper();
}
public LoadResponse execute(HttpPut request) throws IOException {
try (CloseableHttpResponse response = httpClient.execute(request)) {
// ...
}
}
@Override
public void close() throws IOException {
httpClient.close();
}
```
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/DorisLoadClient.java:
##########
@@ -0,0 +1,206 @@
+package org.apache.doris.sdk.load;
+
+import org.apache.doris.sdk.load.config.DorisConfig;
+import org.apache.doris.sdk.load.exception.StreamLoadException;
+import org.apache.doris.sdk.load.internal.RequestBuilder;
+import org.apache.doris.sdk.load.internal.StreamLoader;
+import org.apache.doris.sdk.load.model.LoadResponse;
+import org.apache.http.client.methods.HttpPut;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.zip.GZIPOutputStream;
+
+/**
+ * Thread-safe Doris stream load client.
+ *
+ * <p>Usage:
+ * <pre>
+ * DorisLoadClient client = new DorisLoadClient(config);
+ * LoadResponse resp = client.load(new ByteArrayInputStream(data));
+ * if (resp.getStatus() == LoadResponse.Status.SUCCESS) { ... }
+ * </pre>
+ *
+ * <p>Thread safety: this instance can be shared across threads.
+ * Each {@link #load} call must receive an independent InputStream.
+ */
+public class DorisLoadClient implements AutoCloseable {
+
+ private static final Logger log = LoggerFactory.getLogger(DorisLoadClient.class);
+ /** Absolute maximum for a single backoff interval: 5 minutes. */
+ private static final long ABSOLUTE_MAX_INTERVAL_MS = 300_000L;
+
+ private final DorisConfig config;
+ private final StreamLoader streamLoader;
+
+ public DorisLoadClient(DorisConfig config) {
+ this.config = config;
+ this.streamLoader = new StreamLoader();
+ }
+
+ /** Package-private constructor for testing with a mock StreamLoader. */
+ DorisLoadClient(DorisConfig config, StreamLoader streamLoader) {
+ this.config = config;
+ this.streamLoader = streamLoader;
+ }
+
+ /**
+ * Loads data from the given InputStream into Doris via stream load.
+ * The InputStream is fully consumed and buffered before the first attempt.
+ * Retries with exponential backoff on retryable errors (network/HTTP failures).
+ * Business failures (bad data, schema mismatch, auth) are returned immediately without retry.
+ *
+ * @param inputStream data to load (consumed once; must not be shared across threads)
+ * @return LoadResponse with status SUCCESS or FAILURE
+ * @throws IOException if the stream cannot be read or all retries are exhausted
+ */
+ public LoadResponse load(InputStream inputStream) throws IOException {
+ int maxRetries = 6;
+ long baseIntervalMs = 1000L;
+ long maxTotalTimeMs = 60000L;
+
+ if (config.getRetry() != null) {
+ maxRetries = config.getRetry().getMaxRetryTimes();
+ baseIntervalMs = config.getRetry().getBaseIntervalMs();
+ maxTotalTimeMs = config.getRetry().getMaxTotalTimeMs();
+ }
+
+ log.info("Starting stream load: {}.{}", config.getDatabase(), config.getTable());
+
+ // Buffer the InputStream once so retries can replay the body
+ byte[] bodyData = readAll(inputStream);
+
+ // Compress once before the retry loop (avoids re-compressing on each retry)
+ if (config.isEnableGzip()) {
+ bodyData = gzipCompress(bodyData);
+ }
+ Exception lastException = null;
+ LoadResponse lastResponse = null;
+ long totalRetryTimeMs = 0L;
+ long operationStart = System.currentTimeMillis();
+
+ for (int attempt = 0; attempt <= maxRetries; attempt++) {
+ if (attempt > 0) {
+ log.info("Retry attempt {}/{}", attempt, maxRetries);
+ long backoff = calculateBackoffMs(attempt, baseIntervalMs, maxTotalTimeMs, totalRetryTimeMs);
+
+ if (maxTotalTimeMs > 0 && totalRetryTimeMs + backoff > maxTotalTimeMs) {
+ log.warn("Next retry backoff ({}ms) would exceed total limit ({}ms). Stopping.", backoff, maxTotalTimeMs);
+ break;
+ }
+
+ log.info("Waiting {}ms before retry (total retry time so far: {}ms)", backoff, totalRetryTimeMs);
+ sleep(backoff);
+ totalRetryTimeMs += backoff;
+ } else {
+ log.info("Initial load attempt");
+ }
+
+ try {
+ HttpPut request = RequestBuilder.build(config, bodyData, attempt);
+ lastResponse = streamLoader.execute(request);
+
+ if (lastResponse.getStatus() == LoadResponse.Status.SUCCESS) {
+ log.info("Stream load succeeded on attempt {}", attempt + 1);
+ return lastResponse;
+ }
+
+ // Business failure (bad data, schema mismatch, auth) — do not retry
+ log.error("Load failed (non-retryable): {}", lastResponse.getErrorMessage());
+ return lastResponse;
+
+ } catch (StreamLoadException e) {
+ // Retryable: network error, HTTP 5xx, etc.
+ lastException = e;
+ log.error("Attempt {} failed with retryable error: ", attempt + 1, e);
+ } catch (Exception e) {
+ // Wrap unexpected exceptions as retryable
Review Comment:
**[Bug] Asymmetric error handling between `StreamLoadException` and generic `Exception`.**
The `StreamLoadException` catch (line 115) simply records the exception and lets the loop continue to the next iteration's backoff check. But this generic `Exception` catch has two additional guards:
1. `attempt == maxRetries` check (line 124) — breaks immediately on last retry
2. Wall-clock elapsed time check (lines 130-133)
The `StreamLoadException` path lacks both of these. Since `StreamLoadException` is the expected retryable error (connection failures, HTTP 5xx), it's the more common retry path and should have the same safeguards.
Also, wrapping generic `Exception` as retryable at line 121 is questionable — `NullPointerException`, `IllegalArgumentException`, etc. are programming errors that should not be retried.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/load/internal/RequestBuilder.java:
##########
@@ -0,0 +1,144 @@
+package org.apache.doris.sdk.load.internal;
+
+import org.apache.doris.sdk.load.config.DorisConfig;
+import org.apache.doris.sdk.load.config.GroupCommitMode;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.entity.ByteArrayEntity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.UUID;
+
+/**
+ * Builds HttpPut requests for Doris stream load.
+ * Handles header assembly, label generation, and group commit logic.
+ */
+public class RequestBuilder {
+
+ private static final Logger log = LoggerFactory.getLogger(RequestBuilder.class);
+ private static final String STREAM_LOAD_PATTERN = "http://%s/api/%s/%s/_stream_load";
+ private static final Random RANDOM = new Random();
Review Comment:
**[Bug] HTTPS endpoints silently downgraded to HTTP.**
`STREAM_LOAD_PATTERN` hardcodes `http://`, while `pickEndpoint()` (line 138-142) strips both `http://` and `https://` prefixes. If a user configures `https://fe1:8030`, the scheme is stripped and then reconstructed as `http://fe1:8030/api/...`, silently downgrading to unencrypted HTTP.
**Fix**: Preserve the original scheme from the endpoint, or reconstruct the URL using the endpoint directly:
```java
private static final String STREAM_LOAD_PATTERN = "%s/api/%s/%s/_stream_load";
// In build():
String endpoint = pickEndpoint(config.getEndpoints()); // keep scheme
String url = String.format(STREAM_LOAD_PATTERN, endpoint, config.getDatabase(), config.getTable());
```
And remove the scheme-stripping from `pickEndpoint()`.
##########
sdk/java-doris-sdk/src/main/java/org/apache/doris/sdk/DorisClient.java:
##########
@@ -0,0 +1,65 @@
+package org.apache.doris.sdk;
+
Review Comment:
**[Compliance] Missing Apache Software Foundation license header.** This file and 12 other core source files + 5 test files are missing the ASF license header that is required for Apache projects. The example files have it correctly. All `.java` files should have the license header.
Missing from:
- `DorisClient.java`, `DorisLoadClient.java`, `StreamLoader.java`, `RequestBuilder.java`
- `DorisConfig.java`, `CsvFormat.java`, `JsonFormat.java`, `Format.java`, `GroupCommitMode.java`, `RetryConfig.java`
- `StreamLoadException.java`, `LoadResponse.java`, `RespContent.java`
- All 5 test files
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Enhancement](sdk) Add java SDK as a subproject under sdk/java-doris-sdk [doris]
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #61626:
URL: https://github.com/apache/doris/pull/61626#issuecomment-4108842995
Thank you for your contribution to Apache Doris.
Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/How+to+process+your+PR).
Please clearly describe your PR:
1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
3. What features were added. Why was this function added?
4. Which code was refactored and why was this part of the code refactored?
5. Which functions were optimized and what is the difference before and after the optimization?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Enhancement](sdk) Add java SDK as a subproject under sdk/java-doris-sdk [doris]
Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba commented on PR #61626:
URL: https://github.com/apache/doris/pull/61626#issuecomment-4115661223
run buildall
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Enhancement](sdk) Add java SDK as a subproject under sdk/java-doris-sdk [doris]
Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba commented on PR #61626:
URL: https://github.com/apache/doris/pull/61626#issuecomment-4109369041
run buildall
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org