File tree Expand file tree Collapse file tree 4 files changed +16
-0
lines changed
test/java/org/apache/skywalking/banyandb/v1/client Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,13 @@ Changes by Version
22==================
33Release Notes.
44
5+ 0.9.0
6+ ------------------
7+
8+ ### Features
9+
10+ * Bump up the API to support sharding_key.
11+
5120.8.0
613------------------
714
Original file line number Diff line number Diff line change @@ -226,6 +226,7 @@ Measure m = Measure.newBuilder()
226226 .setName(" service_cpm_minute" ))
227227 .setInterval(Duration . ofMinutes(1 ). format())
228228 .setEntity(Entity . newBuilder(). addTagNames(" entity_id" ))
229+ .setShardingKey(ShardingKey . newBuilder(). addTagNames(" service_id" ))
229230 .addTagFamilies(
230231 TagFamilySpec . newBuilder()
231232 .setName(" default" )
Original file line number Diff line number Diff line change @@ -96,6 +96,10 @@ message FieldSpec {
9696 CompressionMethod compression_method = 4 [(validate.rules ) .enum.defined_only = true ];
9797}
9898
99+ message ShardingKey {
100+ repeated string tag_names = 1 [(validate.rules ) .repeated.min_items = 1 ];
101+ }
102+
99103// Measure intends to store data point
100104message Measure {
101105 // metadata is the identity of a measure
@@ -114,6 +118,8 @@ message Measure {
114118 // index_mode specifies whether the data should be stored exclusively in the index,
115119 // meaning it will not be stored in the data storage system.
116120 bool index_mode = 7 ;
121+ // sharding_key determines the distribution of TopN-related data.
122+ ShardingKey sharding_key = 8 ;
117123}
118124
119125// TopNAggregation generates offline TopN statistics for a measure's TopN approximation
Original file line number Diff line number Diff line change 2828import org .apache .skywalking .banyandb .database .v1 .BanyandbDatabase .FieldSpec ;
2929import org .apache .skywalking .banyandb .database .v1 .BanyandbDatabase .FieldType ;
3030import org .apache .skywalking .banyandb .database .v1 .BanyandbDatabase .Measure ;
31+ import org .apache .skywalking .banyandb .database .v1 .BanyandbDatabase .ShardingKey ;
3132import org .apache .skywalking .banyandb .database .v1 .BanyandbDatabase .TagFamilySpec ;
3233import org .apache .skywalking .banyandb .database .v1 .BanyandbDatabase .TagSpec ;
3334import org .apache .skywalking .banyandb .database .v1 .BanyandbDatabase .TagType ;
@@ -102,6 +103,7 @@ private Measure buildMeasure() {
102103 .setName ("service_cpm_minute" ))
103104 .setInterval (Duration .ofMinutes (1 ).format ())
104105 .setEntity (Entity .newBuilder ().addTagNames ("entity_id" ))
106+ .setShardingKey (ShardingKey .newBuilder ().addTagNames ("service_id" ))
105107 .addTagFamilies (
106108 TagFamilySpec .newBuilder ()
107109 .setName ("default" )
You can’t perform that action at this time.
0 commit comments