lib/mergeset: remove unused code after a4140de9e6

This commit is contained in:
Aliaksandr Valialkin 2021-02-16 13:39:54 +02:00
parent ca191696fe
commit 7faa762021

View File

@ -25,9 +25,6 @@ type partSearch struct {
// The remaining block headers to scan in the current metaindexRow. // The remaining block headers to scan in the current metaindexRow.
bhs []blockHeader bhs []blockHeader
// Pointer to inmemory block, which may be reused.
inmemoryBlockReuse *inmemoryBlock
idxbCache *indexBlockCache idxbCache *indexBlockCache
ibCache *inmemoryBlockCache ibCache *inmemoryBlockCache
@ -48,10 +45,6 @@ func (ps *partSearch) reset() {
ps.p = nil ps.p = nil
ps.mrs = nil ps.mrs = nil
ps.bhs = nil ps.bhs = nil
if ps.inmemoryBlockReuse != nil {
putInmemoryBlock(ps.inmemoryBlockReuse)
ps.inmemoryBlockReuse = nil
}
ps.idxbCache = nil ps.idxbCache = nil
ps.ibCache = nil ps.ibCache = nil
ps.err = nil ps.err = nil
@ -240,10 +233,6 @@ func (ps *partSearch) Error() error {
} }
func (ps *partSearch) nextBlock() error { func (ps *partSearch) nextBlock() error {
if ps.inmemoryBlockReuse != nil {
putInmemoryBlock(ps.inmemoryBlockReuse)
ps.inmemoryBlockReuse = nil
}
if len(ps.bhs) == 0 { if len(ps.bhs) == 0 {
// The current metaindexRow is over. Proceed to the next metaindexRow. // The current metaindexRow is over. Proceed to the next metaindexRow.
if err := ps.nextBHS(); err != nil { if err := ps.nextBHS(); err != nil {
@ -252,13 +241,10 @@ func (ps *partSearch) nextBlock() error {
} }
bh := &ps.bhs[0] bh := &ps.bhs[0]
ps.bhs = ps.bhs[1:] ps.bhs = ps.bhs[1:]
ib, mayReuseInmemoryBlock, err := ps.getInmemoryBlock(bh) ib, err := ps.getInmemoryBlock(bh)
if err != nil { if err != nil {
return err return err
} }
if mayReuseInmemoryBlock {
ps.inmemoryBlockReuse = ib
}
ps.ib = ib ps.ib = ib
ps.ibItemIdx = 0 ps.ibItemIdx = 0
return nil return nil
@ -301,19 +287,19 @@ func (ps *partSearch) readIndexBlock(mr *metaindexRow) (*indexBlock, error) {
return idxb, nil return idxb, nil
} }
func (ps *partSearch) getInmemoryBlock(bh *blockHeader) (*inmemoryBlock, bool, error) { func (ps *partSearch) getInmemoryBlock(bh *blockHeader) (*inmemoryBlock, error) {
var ibKey inmemoryBlockCacheKey var ibKey inmemoryBlockCacheKey
ibKey.Init(bh) ibKey.Init(bh)
ib := ps.ibCache.Get(ibKey) ib := ps.ibCache.Get(ibKey)
if ib != nil { if ib != nil {
return ib, false, nil return ib, nil
} }
ib, err := ps.readInmemoryBlock(bh) ib, err := ps.readInmemoryBlock(bh)
if err != nil { if err != nil {
return nil, false, err return nil, err
} }
ps.ibCache.Put(ibKey, ib) ps.ibCache.Put(ibKey, ib)
return ib, false, nil return ib, nil
} }
func (ps *partSearch) readInmemoryBlock(bh *blockHeader) (*inmemoryBlock, error) { func (ps *partSearch) readInmemoryBlock(bh *blockHeader) (*inmemoryBlock, error) {