This is an automated email from the ASF dual-hosted git repository.

hanahmily pushed a commit to branch feat/trace-response
in repository 
https://gitbox.apache.org/repos/asf/skywalking-banyandb-java-client.git

commit 6595b49203a46b54957a14a3771d7365acbce115
Author: Gao Hongtao <hanahm...@gmail.com>
AuthorDate: Mon Sep 1 16:14:27 2025 +0800

    Add trace model
---
 .../banyandb/v1/client/BanyanDBClient.java         | 43 ++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git 
a/src/main/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClient.java 
b/src/main/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClient.java
index bcae829..777aaf1 100644
--- a/src/main/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClient.java
+++ b/src/main/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClient.java
@@ -428,6 +428,49 @@ public class BanyanDBClient implements Closeable {
         return new TraceWrite(this.metadataCache.findTraceMetadata(group, 
name));
     }
 
+    /**
+     * Build a trace bulk write processor.
+     *
+     * @param maxBulkSize   the max size of each flush. The actual size is 
determined by the length of byte array.
+     * @param flushInterval if given maxBulkSize is not reached in this 
period, the flush would be trigger
+     *                      automatically. Unit is second.
+     * @param concurrency   the number of concurrency would run for the flush 
max.
+     * @param timeout       network timeout threshold in seconds.
+     * @return trace bulk write processor
+     */
+    public TraceBulkWriteProcessor buildTraceWriteProcessor(int maxBulkSize, 
int flushInterval, int concurrency, int timeout) {
+        checkState(this.traceServiceStub != null, "trace service is null");
+
+        return new TraceBulkWriteProcessor(this, maxBulkSize, flushInterval, 
concurrency, timeout, WRITE_HISTOGRAM, options);
+    }
+
+    /**
+     * Build a TraceWrite request.
+     *
+     * @param group     the group of the trace
+     * @param name      the name of the trace
+     * @param timestamp the timestamp of the trace
+     * @return the request to be built
+     */
+    public TraceWrite createTraceWrite(String group, String name, long 
timestamp) throws BanyanDBException {
+        Preconditions.checkArgument(!Strings.isNullOrEmpty(group));
+        Preconditions.checkArgument(!Strings.isNullOrEmpty(name));
+        return new TraceWrite(this.metadataCache.findTraceMetadata(group, 
name), timestamp);
+    }
+
+    /**
+     * Build a TraceWrite request without initial timestamp.
+     *
+     * @param group the group of the trace
+     * @param name  the name of the trace
+     * @return the request to be built
+     */
+    public TraceWrite createTraceWrite(String group, String name) throws 
BanyanDBException {
+        Preconditions.checkArgument(!Strings.isNullOrEmpty(group));
+        Preconditions.checkArgument(!Strings.isNullOrEmpty(name));
+        return new TraceWrite(this.metadataCache.findTraceMetadata(group, 
name));
+    }
+
     /**
      * Query streams according to given conditions
      *

Reply via email to