hanahmily commented on a change in pull request #29:
URL: https://github.com/apache/skywalking-banyandb/pull/29#discussion_r683190932
##########
File path: banyand/index/index.go
##########
@@ -108,7 +123,7 @@ func (s *service) Insert(series common.Metadata, shardID
uint, field *Field) err
}
objects, ok := sd.meta[field.Name]
if !ok {
- return ErrUnknownField
+ return nil
Review comment:
Could you record a debug level message to indicates which fields are
ignored?
##########
File path: banyand/index/index.go
##########
@@ -154,6 +169,28 @@ func (s *service) GracefulStop() {
}
}
+func (s *service) Ready(ctx context.Context, options ...ReadyOption) bool {
+ options = append(options, func(m map[string]*series) bool {
+ return len(m) > 0
+ })
+
+ for {
+ select {
+ case <-ctx.Done():
+ return ctx.Err() == nil
+ default:
+ allMatches := true
+ for _, opt := range options {
+ allMatches = allMatches && opt(s.meta.meta)
Review comment:
Could you break the loop once getting a `false` result from `opt()`
instead of iterating all options.
##########
File path: banyand/index/index.go
##########
@@ -154,6 +170,31 @@ func (s *service) GracefulStop() {
}
}
+func (s *service) Ready(ctx context.Context, options ...ReadyOption) bool {
+ options = append(options, func(m map[string]*series) bool {
+ return len(m) > 0
+ })
+
+ for {
+ select {
+ case <-ctx.Done():
+ return ctx.Err() == nil
+ default:
+ allMatches := true
+ for _, opt := range options {
+ allMatches = allMatches && opt(s.meta.meta)
+ if !allMatches {
+ break
+ }
Review comment:
```suggestion
if allMatches = opt(s.meta.meta); !allMatches {
break
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]