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
|
return bs.bsw.p.path
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bs *blockSearch) search(bsw *blockSearchWork) {
|
func (bs *blockSearch) search(bsw *blockSearchWork, bm *bitmap) {
|
||||||
bs.reset()
|
bs.reset()
|
||||||
|
|
||||||
bs.bsw = bsw
|
bs.bsw = bsw
|
||||||
|
@ -154,18 +154,17 @@ func (bs *blockSearch) search(bsw *blockSearchWork) {
|
||||||
bs.csh.initFromBlockHeader(&bs.a, bsw.p, &bsw.bh)
|
bs.csh.initFromBlockHeader(&bs.a, bsw.p, &bsw.bh)
|
||||||
|
|
||||||
// search rows matching the given filter
|
// search rows matching the given filter
|
||||||
bm := getBitmap(int(bsw.bh.rowsCount))
|
bm.init(int(bsw.bh.rowsCount))
|
||||||
defer putBitmap(bm)
|
|
||||||
|
|
||||||
bm.setBits()
|
bm.setBits()
|
||||||
bs.bsw.so.filter.apply(bs, bm)
|
bs.bsw.so.filter.apply(bs, bm)
|
||||||
|
|
||||||
bs.br.mustInit(bs, bm)
|
|
||||||
if bm.isZero() {
|
if bm.isZero() {
|
||||||
// The filter doesn't match any logs in the current block.
|
// The filter doesn't match any logs in the current block.
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bs.br.mustInit(bs, bm)
|
||||||
|
|
||||||
// fetch the requested columns to bs.br.
|
// fetch the requested columns to bs.br.
|
||||||
if bs.bsw.so.needAllColumns {
|
if bs.bsw.so.needAllColumns {
|
||||||
bs.br.initAllColumns()
|
bs.br.initAllColumns()
|
||||||
|
|
|
@ -178,6 +178,7 @@ func (s *Storage) search(workersCount int, so *genericSearchOptions, stopCh <-ch
|
||||||
for i := 0; i < workersCount; i++ {
|
for i := 0; i < workersCount; i++ {
|
||||||
go func(workerID uint) {
|
go func(workerID uint) {
|
||||||
bs := getBlockSearch()
|
bs := getBlockSearch()
|
||||||
|
bm := getBitmap(0)
|
||||||
for bswb := range workCh {
|
for bswb := range workCh {
|
||||||
bsws := bswb.bsws
|
bsws := bswb.bsws
|
||||||
for i := range bsws {
|
for i := range bsws {
|
||||||
|
@ -188,7 +189,7 @@ func (s *Storage) search(workersCount int, so *genericSearchOptions, stopCh <-ch
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
bs.search(bsw)
|
bs.search(bsw, bm)
|
||||||
if len(bs.br.timestamps) > 0 {
|
if len(bs.br.timestamps) > 0 {
|
||||||
processBlockResult(workerID, &bs.br)
|
processBlockResult(workerID, &bs.br)
|
||||||
}
|
}
|
||||||
|
@ -198,6 +199,7 @@ func (s *Storage) search(workersCount int, so *genericSearchOptions, stopCh <-ch
|
||||||
putBlockSearchWorkBatch(bswb)
|
putBlockSearchWorkBatch(bswb)
|
||||||
}
|
}
|
||||||
putBlockSearch(bs)
|
putBlockSearch(bs)
|
||||||
|
putBitmap(bm)
|
||||||
wgWorkers.Done()
|
wgWorkers.Done()
|
||||||
}(uint(i))
|
}(uint(i))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue