You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2023/01/20 03:07:07 UTC

[GitHub] [skywalking-banyandb] lujiajing1126 commented on a diff in pull request #241: fix metadata register bug.

lujiajing1126 commented on code in PR #241:
URL: https://github.com/apache/skywalking-banyandb/pull/241#discussion_r1082069269


##########
api/proto/banyandb/database/v1/schema.proto:
##########
@@ -88,25 +89,25 @@ enum CompressionMethod {
 // FieldSpec is the specification of field
 message FieldSpec {
   // name is the identity of a field
-  string name = 1;
+  string name = 1 [(validate.rules).string.min_len = 1];
   // field_type denotes the type of field value
-  FieldType field_type = 2;
+  FieldType field_type = 2 [(validate.rules).enum.defined_only = true];
   // encoding_method indicates how to encode data during writing
-  EncodingMethod encoding_method = 3;
+  EncodingMethod encoding_method = 3 [(validate.rules).enum.defined_only = true];
   // compression_method indicates how to compress data during writing
-  CompressionMethod compression_method = 4;
+  CompressionMethod compression_method = 4 [(validate.rules).enum.defined_only = true];
 }
 
 // Measure intends to store data point
 message Measure {
   // metadata is the identity of a measure
-  common.v1.Metadata metadata = 1;
+  common.v1.Metadata metadata = 1 [(validate.rules).message.required = true];
   // tag_families are for filter measures
-  repeated TagFamilySpec tag_families = 2;
+  repeated TagFamilySpec tag_families = 2 [(validate.rules).repeated.min_items = 1];
   // fields denote measure values
   repeated FieldSpec fields = 3;
   // entity indicates which tags will be to generate a series and shard a measure
-  Entity entity = 4;
+  Entity entity = 4 [(validate.rules).message.required = true];
   // interval indicates how frequently to send a data point
   // valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h", "d".
   string interval = 5;

Review Comment:
   Is that possbile to validate interval with regex?



##########
banyand/metadata/schema/group.go:
##########
@@ -87,6 +88,9 @@ func (e *etcdSchemaRegistry) DeleteGroup(ctx context.Context, group string) (boo
 }
 
 func (e *etcdSchemaRegistry) CreateGroup(ctx context.Context, group *commonv1.Group) error {
+	if group.UpdatedAt != nil {

Review Comment:
   I suppose we can move `UpdatedAt` field assignment to the `create` and `update` methods



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org