Skip to content

Commit 661a39f

Browse files
authored
Bump API to support version 0.9 (#83)
1 parent f107e80 commit 661a39f

File tree

10 files changed

+21
-47
lines changed

10 files changed

+21
-47
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Release Notes.
88
### Features
99

1010
* Bump up the API to support sharding_key.
11+
* Bump up the API to support version 0.9.
1112

1213
0.8.0
1314
------------------

src/main/java/org/apache/skywalking/banyandb/v1/client/MeasureQuery.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class MeasureQuery extends AbstractQuery<BanyandbMeasure.QueryRequest> {
5050

5151
private OrderBy orderBy;
5252

53-
private String nodeSelector;
53+
private Set<String> stages;
5454

5555
public MeasureQuery(final List<String> groups, final String name, final Set<String> tagProjections, final Set<String> fieldProjections) {
5656
this(groups, name, null, tagProjections, fieldProjections);
@@ -138,8 +138,8 @@ public MeasureQuery offset(int offset) {
138138
return this;
139139
}
140140

141-
public MeasureQuery nodeSelector(String nodeSelector) {
142-
this.nodeSelector = nodeSelector;
141+
public MeasureQuery stages(Set<String> stages) {
142+
this.stages = stages;
143143
return this;
144144
}
145145

@@ -168,8 +168,8 @@ BanyandbMeasure.QueryRequest build(MetadataCache.EntityMetadata entityMetadata)
168168
.addAllNames(fieldProjections)
169169
.build());
170170
}
171-
if (nodeSelector != null && !nodeSelector.isEmpty()) {
172-
builder.setNodeSelector(nodeSelector);
171+
if (stages != null && !stages.isEmpty()) {
172+
builder.addAllStages(stages);
173173
}
174174
if (this.aggregation != null) {
175175
BanyandbMeasure.QueryRequest.GroupBy.Builder groupByBuilder = BanyandbMeasure.QueryRequest.GroupBy.newBuilder()

src/main/java/org/apache/skywalking/banyandb/v1/client/PropertyQuery.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ public class PropertyQuery extends AbstractQuery<BanyandbProperty.QueryRequest>
4242
*/
4343
private List<String> ids;
4444

45-
/**
46-
* Node selector for distributed query routing
47-
*/
48-
private String nodeSelector;
49-
5045
/**
5146
* Construct a property query with required fields
5247
*/
@@ -80,16 +75,6 @@ public PropertyQuery ids(List<String> ids) {
8075
return this;
8176
}
8277

83-
/**
84-
* Set a node selector for query routing
85-
* @param nodeSelector the node selector expression
86-
* @return this query instance for chaining
87-
*/
88-
public PropertyQuery nodeSelector(String nodeSelector) {
89-
this.nodeSelector = nodeSelector;
90-
return this;
91-
}
92-
9378
@Override
9479
public PropertyQuery and(PairQueryCondition<?> condition) {
9580
return (PropertyQuery) super.and(condition);
@@ -118,10 +103,6 @@ public BanyandbProperty.QueryRequest build() throws BanyanDBException {
118103
builder.addAllIds(this.ids);
119104
}
120105

121-
if (this.nodeSelector != null && !this.nodeSelector.isEmpty()) {
122-
builder.setNodeSelector(this.nodeSelector);
123-
}
124-
125106
return builder.build();
126107
}
127108
}

src/main/java/org/apache/skywalking/banyandb/v1/client/StreamQuery.java

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ public class StreamQuery extends AbstractQuery<BanyandbStream.QueryRequest> {
4343
* One order condition is supported and optional.
4444
*/
4545
private OrderBy orderBy;
46-
46+
4747
/**
48-
* Node selector for the query.
48+
* The stages of the stream query.
4949
*/
50-
private String nodeSelector;
50+
private Set<String> stages;
5151

5252
public StreamQuery(final List<String> groups, final String name, final TimestampRange timestampRange, final Set<String> projections) {
5353
super(groups, name, timestampRange, projections);
@@ -69,14 +69,8 @@ public StreamQuery or(PairQueryCondition<?> condition) {
6969
return (StreamQuery) super.or(condition);
7070
}
7171

72-
/**
73-
* Set the node selector for this query.
74-
*
75-
* @param nodeSelector the node selector
76-
* @return this query instance for chaining
77-
*/
78-
public StreamQuery nodeSelector(String nodeSelector) {
79-
this.nodeSelector = nodeSelector;
72+
public StreamQuery stages(Set<String> stages) {
73+
this.stages = stages;
8074
return this;
8175
}
8276

@@ -98,8 +92,8 @@ BanyandbStream.QueryRequest build(MetadataCache.EntityMetadata entityMetadata) t
9892
if (orderBy != null) {
9993
builder.setOrderBy(orderBy.build());
10094
}
101-
if (nodeSelector != null && !nodeSelector.isEmpty()) {
102-
builder.setNodeSelector(nodeSelector);
95+
if (stages != null && !stages.isEmpty()) {
96+
builder.addAllStages(stages);
10397
}
10498
builder.setTrace(this.trace);
10599
return builder.build();

src/main/proto/banyandb/v1/banyandb-common.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ message ResourceOpts {
9292
IntervalRule ttl = 3;
9393
// stages defines the ordered lifecycle stages. Data progresses through these stages sequentially.
9494
repeated LifecycleStage stages = 4;
95-
// default_node_selector is the default node selector for queries if node_selector is not specified
96-
string default_node_selector = 5;
95+
// default_stages is the name of the default stage
96+
repeated string default_stages = 5;
9797
}
9898

9999
// Group is an internal object for Group management

src/main/proto/banyandb/v1/banyandb-measure.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ message QueryRequest {
104104
model.v1.QueryOrder order_by = 12;
105105
// trace is used to enable trace for the query
106106
bool trace = 13;
107-
// node_selector is used to specify the target node for the query
108-
string node_selector = 14;
107+
// stages is used to specify the stage of the data points in the lifecycle
108+
repeated string stages = 14;
109109
}
110110

111111
// TopNList contains a series of topN items

src/main/proto/banyandb/v1/banyandb-property.proto

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ message QueryRequest {
8484
uint32 limit = 6;
8585
// trace is used to enable trace for the query
8686
bool trace = 7;
87-
// node_selector is used to select the node to query
88-
string node_selector = 8;
8987
}
9088

9189
// QueryResponse is the response for a query to the Query module.

src/main/proto/banyandb/v1/banyandb-stream.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ message QueryRequest {
7676
model.v1.TagProjection projection = 8 [(validate.rules).message.required = true];
7777
// trace is used to enable trace for the query
7878
bool trace = 9;
79-
// node_selector is used to select the node to query
80-
string node_selector = 10;
79+
// stage is used to specify the stage of the query in the lifecycle
80+
repeated string stages = 10;
8181
}
8282

8383
message ElementValue {

src/test/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClientTestCI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
public class BanyanDBClientTestCI {
3232
private static final String REGISTRY = "ghcr.io";
3333
private static final String IMAGE_NAME = "apache/skywalking-banyandb";
34-
private static final String TAG = "53b3be42d162e2f4ef0c667dc30f25e42ff17d70";
34+
private static final String TAG = "c190598804f9dd651b19a188cac2869bf4d8f5c7";
3535

3636
private static final String IMAGE = REGISTRY + "/" + IMAGE_NAME + ":" + TAG;
3737

src/test/java/org/apache/skywalking/banyandb/v1/client/ITBanyanDBCommonTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void tearDown() throws IOException {
4242
@Test
4343
public void test_GetAPIVersion() throws BanyanDBException {
4444
BanyandbCommon.APIVersion version = this.client.getAPIVersion();
45-
Assert.assertEquals("0.8", version.getVersion());
45+
Assert.assertEquals("0.9", version.getVersion());
4646
Assert.assertFalse(Strings.isNullOrEmpty(version.getRevision()));
4747
}
4848

0 commit comments

Comments
 (0)