mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-31 15:06:26 +00:00
wip
This commit is contained in:
parent
4a819f65f2
commit
0418bd0fa9
2 changed files with 10 additions and 10 deletions
|
@ -24,15 +24,15 @@ type filter interface {
|
|||
apply(bs *blockSearch, bm *bitmap)
|
||||
}
|
||||
|
||||
// noopFilter does nothing
|
||||
type noopFilter struct {
|
||||
// filterNoop does nothing
|
||||
type filterNoop struct {
|
||||
}
|
||||
|
||||
func (nf *noopFilter) String() string {
|
||||
func (fn *filterNoop) String() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (nf *noopFilter) apply(_ *blockSearch, _ *bitmap) {
|
||||
func (fn *filterNoop) apply(_ *blockSearch, _ *bitmap) {
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
|
@ -168,21 +168,21 @@ type notFilter struct {
|
|||
f filter
|
||||
}
|
||||
|
||||
func (nf *notFilter) String() string {
|
||||
s := nf.f.String()
|
||||
switch nf.f.(type) {
|
||||
func (fn *notFilter) String() string {
|
||||
s := fn.f.String()
|
||||
switch fn.f.(type) {
|
||||
case *andFilter, *orFilter:
|
||||
s = "(" + s + ")"
|
||||
}
|
||||
return "!" + s
|
||||
}
|
||||
|
||||
func (nf *notFilter) apply(bs *blockSearch, bm *bitmap) {
|
||||
func (fn *notFilter) apply(bs *blockSearch, bm *bitmap) {
|
||||
// Minimize the number of rows to check by the filter by applying it
|
||||
// only to the rows, which match the bm, e.g. they may change the bm result.
|
||||
bmTmp := getBitmap(bm.bitsLen)
|
||||
bmTmp.copyFrom(bm)
|
||||
nf.f.apply(bs, bmTmp)
|
||||
fn.f.apply(bs, bmTmp)
|
||||
bm.andNot(bmTmp)
|
||||
putBitmap(bmTmp)
|
||||
}
|
||||
|
|
|
@ -708,7 +708,7 @@ func getCommonStreamFilter(f filter) (*StreamFilter, filter) {
|
|||
}
|
||||
}
|
||||
case *streamFilter:
|
||||
return t.f, &noopFilter{}
|
||||
return t.f, &filterNoop{}
|
||||
}
|
||||
return nil, f
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue