Skip to content

Commit 0c0d2df

Browse files
authored
Sync API to support the index mode (#73)
1 parent e3f58db commit 0c0d2df

File tree

5 files changed

+44
-2
lines changed

5 files changed

+44
-2
lines changed

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ Changes by Version
22
==================
33
Release Notes.
44

5+
0.8.0
6+
7+
### Features
8+
9+
* Bump up the API to support the index mode of Measure.
10+
511
0.7.0
612
------------------
713

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ message Measure {
113113
string interval = 5;
114114
// updated_at indicates when the measure is updated
115115
google.protobuf.Timestamp updated_at = 6;
116+
// index_mode specifies whether the data should be stored exclusively in the index,
117+
// meaning it will not be stored in the data storage system.
118+
bool index_mode = 7;
116119
}
117120

118121
message MeasureAggregateFunction {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ package banyandb.model.v1;
2323

2424
import "google/protobuf/timestamp.proto";
2525
import "google/protobuf/struct.proto";
26-
import "validate/validate.proto";
2726

2827
message Str {
2928
string value = 1;

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 = "9770bf48f9b88574683f56e2a137555cd68066d9";
34+
private static final String TAG = "079483262016e8b2ac58c3f115f974d8ad7e9d2e";
3535

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

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,38 @@ private Measure buildMeasure() {
145145
EncodingMethod.ENCODING_METHOD_GORILLA));
146146
return builder.build();
147147
}
148+
149+
@Test
150+
public void testIndexMeasureRegistry_createAndGet() throws BanyanDBException {
151+
Measure expectedMeasure = buildIndexMeasure();
152+
this.client.define(expectedMeasure);
153+
Measure actualMeasure = client.findMeasure("sw_metric", "service_traffic");
154+
Assert.assertNotNull(actualMeasure);
155+
Assert.assertNotNull(actualMeasure.getUpdatedAt());
156+
actualMeasure = actualMeasure.toBuilder().clearUpdatedAt().setMetadata(actualMeasure.getMetadata().toBuilder().clearModRevision().clearCreateRevision()).build();
157+
Assert.assertEquals(expectedMeasure, actualMeasure);
158+
}
159+
160+
private Measure buildIndexMeasure() {
161+
Measure.Builder builder = Measure.newBuilder()
162+
.setMetadata(Metadata.newBuilder()
163+
.setGroup("sw_metric")
164+
.setName("service_traffic"))
165+
.setEntity(Entity.newBuilder().addTagNames("id"))
166+
.setIndexMode(true)
167+
.addTagFamilies(
168+
TagFamilySpec.newBuilder()
169+
.setName("default")
170+
.addTags(
171+
TagSpec.newBuilder()
172+
.setName("id")
173+
.setType(
174+
TagType.TAG_TYPE_STRING))
175+
.addTags(
176+
TagSpec.newBuilder()
177+
.setName("service_name")
178+
.setType(
179+
TagType.TAG_TYPE_STRING)));
180+
return builder.build();
181+
}
148182
}

0 commit comments

Comments
 (0)