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 2021/08/05 06:42:13 UTC

[GitHub] [skywalking-banyandb] lujiajing1126 opened a new pull request #29: Refactor index startup and remove index field check

lujiajing1126 opened a new pull request #29:
URL: https://github.com/apache/skywalking-banyandb/pull/29


   Signed-off-by: Megrez Lu <lu...@gmail.com>


-- 
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



[GitHub] [skywalking-banyandb] hanahmily merged pull request #29: Refactor index startup and remove index field check

Posted by GitBox <gi...@apache.org>.
hanahmily merged pull request #29:
URL: https://github.com/apache/skywalking-banyandb/pull/29


   


-- 
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



[GitHub] [skywalking-banyandb] hanahmily commented on a change in pull request #29: Refactor index startup and remove index field check

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #29:
URL: https://github.com/apache/skywalking-banyandb/pull/29#discussion_r683191874



##########
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.




-- 
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



[GitHub] [skywalking-banyandb] hanahmily merged pull request #29: Refactor index startup and remove index field check

Posted by GitBox <gi...@apache.org>.
hanahmily merged pull request #29:
URL: https://github.com/apache/skywalking-banyandb/pull/29


   


-- 
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



[GitHub] [skywalking-banyandb] lujiajing1126 commented on a change in pull request #29: Refactor index startup and remove index field check

Posted by GitBox <gi...@apache.org>.
lujiajing1126 commented on a change in pull request #29:
URL: https://github.com/apache/skywalking-banyandb/pull/29#discussion_r683195725



##########
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:
       Added

##########
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:
       Fixed




-- 
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



[GitHub] [skywalking-banyandb] hanahmily commented on a change in pull request #29: Refactor index startup and remove index field check

Posted by GitBox <gi...@apache.org>.
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-banyandb] hanahmily commented on a change in pull request #29: Refactor index startup and remove index field check

Posted by GitBox <gi...@apache.org>.
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?




-- 
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



[GitHub] [skywalking-banyandb] hanahmily commented on a change in pull request #29: Refactor index startup and remove index field check

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #29:
URL: https://github.com/apache/skywalking-banyandb/pull/29#discussion_r683198756



##########
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: notifications-unsubscribe@skywalking.apache.org

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



[GitHub] [skywalking-banyandb] lujiajing1126 commented on a change in pull request #29: Refactor index startup and remove index field check

Posted by GitBox <gi...@apache.org>.
lujiajing1126 commented on a change in pull request #29:
URL: https://github.com/apache/skywalking-banyandb/pull/29#discussion_r683195725



##########
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:
       Added

##########
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:
       Fixed




-- 
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