hanahmily commented on code in PR #813:
URL:
https://github.com/apache/skywalking-banyandb/pull/813#discussion_r2443566975
##########
banyand/trace/snapshot.go:
##########
@@ -59,14 +59,28 @@ type snapshot struct {
ref int32
}
-func (s *snapshot) getParts(dst []*part, minTimestamp int64, maxTimestamp
int64) ([]*part, int) {
+func (s *snapshot) getParts(dst []*part, minTimestamp int64, maxTimestamp
int64, traceIDs []string) ([]*part, int) {
+ shouldSkip := func(p *part) bool {
+ if p.traceIDFilter.filter == nil {
+ return false
+ }
+ for _, traceID := range traceIDs {
+ if p.traceIDFilter.filter.MightContain([]byte(traceID))
{
Review Comment:
Use "convert.StringToBytes" to covert traceID
##########
banyand/trace/query_test.go:
##########
@@ -98,7 +98,7 @@ func TestQueryResult(t *testing.T) {
s := tst.currentSnapshot()
require.NotNil(t, s)
defer s.decRef()
- pp, _ := s.getParts(nil,
queryOpts.minTimestamp, queryOpts.maxTimestamp)
+ pp, _ := s.getParts(nil,
queryOpts.minTimestamp, queryOpts.maxTimestamp, nil)
Review Comment:
Add cases to verify the traceID filter
--
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]