mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 16:30:55 +01:00
lib/mergeset: use the given compressLevel for index and metaindex compression in in-memory part
Previously only data was compressed with the given compressLevel
This commit is contained in:
parent
7ffa66d249
commit
eca7f32151
@ -60,14 +60,14 @@ func (mp *inmemoryPart) Init(ib *inmemoryBlock) {
|
|||||||
|
|
||||||
bb := inmemoryPartBytePool.Get()
|
bb := inmemoryPartBytePool.Get()
|
||||||
bb.B = mp.bh.Marshal(bb.B[:0])
|
bb.B = mp.bh.Marshal(bb.B[:0])
|
||||||
mp.indexData.B = encoding.CompressZSTDLevel(mp.indexData.B[:0], bb.B, 0)
|
mp.indexData.B = encoding.CompressZSTDLevel(mp.indexData.B[:0], bb.B, compressLevel)
|
||||||
|
|
||||||
mp.mr.firstItem = append(mp.mr.firstItem[:0], mp.bh.firstItem...)
|
mp.mr.firstItem = append(mp.mr.firstItem[:0], mp.bh.firstItem...)
|
||||||
mp.mr.blockHeadersCount = 1
|
mp.mr.blockHeadersCount = 1
|
||||||
mp.mr.indexBlockOffset = 0
|
mp.mr.indexBlockOffset = 0
|
||||||
mp.mr.indexBlockSize = uint32(len(mp.indexData.B))
|
mp.mr.indexBlockSize = uint32(len(mp.indexData.B))
|
||||||
bb.B = mp.mr.Marshal(bb.B[:0])
|
bb.B = mp.mr.Marshal(bb.B[:0])
|
||||||
mp.metaindexData.B = encoding.CompressZSTDLevel(mp.metaindexData.B[:0], bb.B, 0)
|
mp.metaindexData.B = encoding.CompressZSTDLevel(mp.metaindexData.B[:0], bb.B, compressLevel)
|
||||||
inmemoryPartBytePool.Put(bb)
|
inmemoryPartBytePool.Put(bb)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user