mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-31 15:06:26 +00:00
wip
This commit is contained in:
parent
d50273d6c0
commit
0d71dc22ca
2 changed files with 7 additions and 6 deletions
|
@ -146,7 +146,7 @@ func (bs *blockSearch) partPath() string {
|
|||
return bs.bsw.p.path
|
||||
}
|
||||
|
||||
func (bs *blockSearch) search(bsw *blockSearchWork) {
|
||||
func (bs *blockSearch) search(bsw *blockSearchWork, bm *bitmap) {
|
||||
bs.reset()
|
||||
|
||||
bs.bsw = bsw
|
||||
|
@ -154,18 +154,17 @@ func (bs *blockSearch) search(bsw *blockSearchWork) {
|
|||
bs.csh.initFromBlockHeader(&bs.a, bsw.p, &bsw.bh)
|
||||
|
||||
// search rows matching the given filter
|
||||
bm := getBitmap(int(bsw.bh.rowsCount))
|
||||
defer putBitmap(bm)
|
||||
|
||||
bm.init(int(bsw.bh.rowsCount))
|
||||
bm.setBits()
|
||||
bs.bsw.so.filter.apply(bs, bm)
|
||||
|
||||
bs.br.mustInit(bs, bm)
|
||||
if bm.isZero() {
|
||||
// The filter doesn't match any logs in the current block.
|
||||
return
|
||||
}
|
||||
|
||||
bs.br.mustInit(bs, bm)
|
||||
|
||||
// fetch the requested columns to bs.br.
|
||||
if bs.bsw.so.needAllColumns {
|
||||
bs.br.initAllColumns()
|
||||
|
|
|
@ -178,6 +178,7 @@ func (s *Storage) search(workersCount int, so *genericSearchOptions, stopCh <-ch
|
|||
for i := 0; i < workersCount; i++ {
|
||||
go func(workerID uint) {
|
||||
bs := getBlockSearch()
|
||||
bm := getBitmap(0)
|
||||
for bswb := range workCh {
|
||||
bsws := bswb.bsws
|
||||
for i := range bsws {
|
||||
|
@ -188,7 +189,7 @@ func (s *Storage) search(workersCount int, so *genericSearchOptions, stopCh <-ch
|
|||
continue
|
||||
}
|
||||
|
||||
bs.search(bsw)
|
||||
bs.search(bsw, bm)
|
||||
if len(bs.br.timestamps) > 0 {
|
||||
processBlockResult(workerID, &bs.br)
|
||||
}
|
||||
|
@ -198,6 +199,7 @@ func (s *Storage) search(workersCount int, so *genericSearchOptions, stopCh <-ch
|
|||
putBlockSearchWorkBatch(bswb)
|
||||
}
|
||||
putBlockSearch(bs)
|
||||
putBitmap(bm)
|
||||
wgWorkers.Done()
|
||||
}(uint(i))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue