You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ha...@apache.org on 2025/04/14 05:21:23 UTC

(skywalking-banyandb-java-client) branch lm created (now c8bfb1d)

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

hanahmily pushed a change to branch lm
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb-java-client.git


      at c8bfb1d  Bump API to support version 0.9

This branch includes the following new commits:

     new c8bfb1d  Bump API to support version 0.9

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(skywalking-banyandb-java-client) 01/01: Bump API to support version 0.9

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c8bfb1dd94867c843c68a43ee18a4d51baafb002
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Mon Apr 14 13:19:42 2025 +0800

    Bump API to support version 0.9
    
    Signed-off-by: Gao Hongtao <ha...@gmail.com>
---
 CHANGES.md                                           |  1 +
 .../skywalking/banyandb/v1/client/MeasureQuery.java  | 10 +++++-----
 .../skywalking/banyandb/v1/client/PropertyQuery.java | 19 -------------------
 .../skywalking/banyandb/v1/client/StreamQuery.java   | 20 +++++++-------------
 src/main/proto/banyandb/v1/banyandb-common.proto     |  4 ++--
 src/main/proto/banyandb/v1/banyandb-measure.proto    |  4 ++--
 src/main/proto/banyandb/v1/banyandb-property.proto   |  2 --
 src/main/proto/banyandb/v1/banyandb-stream.proto     |  4 ++--
 .../banyandb/v1/client/BanyanDBClientTestCI.java     |  2 +-
 .../banyandb/v1/client/ITBanyanDBCommonTests.java    |  2 +-
 10 files changed, 21 insertions(+), 47 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index 7c58edc..bb4a29e 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -8,6 +8,7 @@ Release Notes.
 ### Features
 
 * Bump up the API to support sharding_key.
+* Bump up the API to support version 0.9.
 
 0.8.0
 ------------------
diff --git a/src/main/java/org/apache/skywalking/banyandb/v1/client/MeasureQuery.java b/src/main/java/org/apache/skywalking/banyandb/v1/client/MeasureQuery.java
index c60c7a5..f542d39 100644
--- a/src/main/java/org/apache/skywalking/banyandb/v1/client/MeasureQuery.java
+++ b/src/main/java/org/apache/skywalking/banyandb/v1/client/MeasureQuery.java
@@ -50,7 +50,7 @@ public class MeasureQuery extends AbstractQuery<BanyandbMeasure.QueryRequest> {
 
     private OrderBy orderBy;
 
-    private String nodeSelector;
+    private Set<String> stages;
 
     public MeasureQuery(final List<String> groups, final String name, final Set<String> tagProjections, final Set<String> fieldProjections) {
         this(groups, name, null, tagProjections, fieldProjections);
@@ -138,8 +138,8 @@ public class MeasureQuery extends AbstractQuery<BanyandbMeasure.QueryRequest> {
         return this;
     }
 
-    public MeasureQuery nodeSelector(String nodeSelector) {
-        this.nodeSelector = nodeSelector;
+    public MeasureQuery stages(Set<String> stages) {
+        this.stages = stages;
         return this;
     }
 
@@ -168,8 +168,8 @@ public class MeasureQuery extends AbstractQuery<BanyandbMeasure.QueryRequest> {
                     .addAllNames(fieldProjections)
                     .build());
         }
-        if (nodeSelector != null && !nodeSelector.isEmpty()) {
-            builder.setNodeSelector(nodeSelector);
+        if (stages != null && !stages.isEmpty()) {
+            builder.addAllStages(stages);
         }
         if (this.aggregation != null) {
             BanyandbMeasure.QueryRequest.GroupBy.Builder groupByBuilder = BanyandbMeasure.QueryRequest.GroupBy.newBuilder()
diff --git a/src/main/java/org/apache/skywalking/banyandb/v1/client/PropertyQuery.java b/src/main/java/org/apache/skywalking/banyandb/v1/client/PropertyQuery.java
index 42ab04b..0f5a105 100644
--- a/src/main/java/org/apache/skywalking/banyandb/v1/client/PropertyQuery.java
+++ b/src/main/java/org/apache/skywalking/banyandb/v1/client/PropertyQuery.java
@@ -42,11 +42,6 @@ public class PropertyQuery extends AbstractQuery<BanyandbProperty.QueryRequest>
      */
     private List<String> ids;
     
-    /**
-     * Node selector for distributed query routing
-     */
-    private String nodeSelector;
-
     /**
      * Construct a property query with required fields
      */
@@ -80,16 +75,6 @@ public class PropertyQuery extends AbstractQuery<BanyandbProperty.QueryRequest>
         return this;
     }
     
-    /**
-     * Set a node selector for query routing
-     * @param nodeSelector the node selector expression
-     * @return this query instance for chaining
-     */
-    public PropertyQuery nodeSelector(String nodeSelector) {
-        this.nodeSelector = nodeSelector;
-        return this;
-    }
-
     @Override
     public PropertyQuery and(PairQueryCondition<?> condition) {
         return (PropertyQuery) super.and(condition);
@@ -118,10 +103,6 @@ public class PropertyQuery extends AbstractQuery<BanyandbProperty.QueryRequest>
             builder.addAllIds(this.ids);
         }
         
-        if (this.nodeSelector != null && !this.nodeSelector.isEmpty()) {
-            builder.setNodeSelector(this.nodeSelector);
-        }
-        
         return builder.build();
     }
 }
diff --git a/src/main/java/org/apache/skywalking/banyandb/v1/client/StreamQuery.java b/src/main/java/org/apache/skywalking/banyandb/v1/client/StreamQuery.java
index f18b87b..c214d71 100644
--- a/src/main/java/org/apache/skywalking/banyandb/v1/client/StreamQuery.java
+++ b/src/main/java/org/apache/skywalking/banyandb/v1/client/StreamQuery.java
@@ -43,11 +43,11 @@ public class StreamQuery extends AbstractQuery<BanyandbStream.QueryRequest> {
      * One order condition is supported and optional.
      */
     private OrderBy orderBy;
-    
+
     /**
-     * Node selector for the query.
+     * The stages of the stream query.
      */
-    private String nodeSelector;
+    private Set<String> stages;
 
     public StreamQuery(final List<String> groups, final String name, final TimestampRange timestampRange, final Set<String> projections) {
         super(groups, name, timestampRange, projections);
@@ -69,14 +69,8 @@ public class StreamQuery extends AbstractQuery<BanyandbStream.QueryRequest> {
         return (StreamQuery) super.or(condition);
     }
     
-    /**
-     * Set the node selector for this query.
-     *
-     * @param nodeSelector the node selector
-     * @return this query instance for chaining
-     */
-    public StreamQuery nodeSelector(String nodeSelector) {
-        this.nodeSelector = nodeSelector;
+    public StreamQuery stages(Set<String> stages) {
+        this.stages = stages;
         return this;
     }
 
@@ -98,8 +92,8 @@ public class StreamQuery extends AbstractQuery<BanyandbStream.QueryRequest> {
         if (orderBy != null) {
             builder.setOrderBy(orderBy.build());
         }
-        if (nodeSelector != null && !nodeSelector.isEmpty()) {
-            builder.setNodeSelector(nodeSelector);
+        if (stages != null && !stages.isEmpty()) {
+            builder.addAllStages(stages);
         }
         builder.setTrace(this.trace);
         return builder.build();
diff --git a/src/main/proto/banyandb/v1/banyandb-common.proto b/src/main/proto/banyandb/v1/banyandb-common.proto
index 979bf6c..fbe412a 100644
--- a/src/main/proto/banyandb/v1/banyandb-common.proto
+++ b/src/main/proto/banyandb/v1/banyandb-common.proto
@@ -92,8 +92,8 @@ message ResourceOpts {
   IntervalRule ttl = 3;
   // stages defines the ordered lifecycle stages. Data progresses through these stages sequentially.
   repeated LifecycleStage stages = 4;
-  // default_node_selector is the default node selector for queries if node_selector is not specified
-  string default_node_selector = 5;
+  // default_stages is the name of the default stage
+  repeated string default_stages = 5;
 }
 
 // Group is an internal object for Group management
diff --git a/src/main/proto/banyandb/v1/banyandb-measure.proto b/src/main/proto/banyandb/v1/banyandb-measure.proto
index 2c1b9b6..e7b4de1 100644
--- a/src/main/proto/banyandb/v1/banyandb-measure.proto
+++ b/src/main/proto/banyandb/v1/banyandb-measure.proto
@@ -104,8 +104,8 @@ message QueryRequest {
   model.v1.QueryOrder order_by = 12;
   // trace is used to enable trace for the query
   bool trace = 13;
-  // node_selector is used to specify the target node for the query
-  string node_selector = 14;
+  // stages is used to specify the stage of the data points in the lifecycle
+  repeated string stages = 14;
 }
 
 // TopNList contains a series of topN items
diff --git a/src/main/proto/banyandb/v1/banyandb-property.proto b/src/main/proto/banyandb/v1/banyandb-property.proto
index 2f00370..61a378f 100644
--- a/src/main/proto/banyandb/v1/banyandb-property.proto
+++ b/src/main/proto/banyandb/v1/banyandb-property.proto
@@ -84,8 +84,6 @@ message QueryRequest {
   uint32 limit = 6;
   // trace is used to enable trace for the query
   bool trace = 7;
-  // node_selector is used to select the node to query
-  string node_selector = 8;
 }
 
 // QueryResponse is the response for a query to the Query module.
diff --git a/src/main/proto/banyandb/v1/banyandb-stream.proto b/src/main/proto/banyandb/v1/banyandb-stream.proto
index 4934370..5f1f8a6 100644
--- a/src/main/proto/banyandb/v1/banyandb-stream.proto
+++ b/src/main/proto/banyandb/v1/banyandb-stream.proto
@@ -76,8 +76,8 @@ message QueryRequest {
   model.v1.TagProjection projection = 8 [(validate.rules).message.required = true];
   // trace is used to enable trace for the query
   bool trace = 9;
-  // node_selector is used to select the node to query
-  string node_selector = 10;
+  // stage is used to specify the stage of the query in the lifecycle
+  repeated string stages = 10;
 }
 
 message ElementValue {
diff --git a/src/test/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClientTestCI.java b/src/test/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClientTestCI.java
index ca826a3..d2b3f86 100644
--- a/src/test/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClientTestCI.java
+++ b/src/test/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClientTestCI.java
@@ -31,7 +31,7 @@ import java.io.IOException;
 public class BanyanDBClientTestCI {
     private static final String REGISTRY = "ghcr.io";
     private static final String IMAGE_NAME = "apache/skywalking-banyandb";
-    private static final String TAG = "53b3be42d162e2f4ef0c667dc30f25e42ff17d70";
+    private static final String TAG = "c190598804f9dd651b19a188cac2869bf4d8f5c7";
 
     private static final String IMAGE = REGISTRY + "/" + IMAGE_NAME + ":" + TAG;
 
diff --git a/src/test/java/org/apache/skywalking/banyandb/v1/client/ITBanyanDBCommonTests.java b/src/test/java/org/apache/skywalking/banyandb/v1/client/ITBanyanDBCommonTests.java
index d82c0bd..4feb17d 100644
--- a/src/test/java/org/apache/skywalking/banyandb/v1/client/ITBanyanDBCommonTests.java
+++ b/src/test/java/org/apache/skywalking/banyandb/v1/client/ITBanyanDBCommonTests.java
@@ -42,7 +42,7 @@ public class ITBanyanDBCommonTests extends BanyanDBClientTestCI {
     @Test
     public void test_GetAPIVersion() throws BanyanDBException {
         BanyandbCommon.APIVersion version = this.client.getAPIVersion();
-        Assert.assertEquals("0.8", version.getVersion());
+        Assert.assertEquals("0.9", version.getVersion());
         Assert.assertFalse(Strings.isNullOrEmpty(version.getRevision()));
     }