diff --git a/lib/mergeset/block_stream_reader.go b/lib/mergeset/block_stream_reader.go index 83d0fc5ed..a48bbe9c4 100644 --- a/lib/mergeset/block_stream_reader.go +++ b/lib/mergeset/block_stream_reader.go @@ -98,20 +98,20 @@ func (bsr *blockStreamReader) String() string { return bsr.ph.String() } -// InitFromInmemoryPart initializes bsr from the given ip. -func (bsr *blockStreamReader) InitFromInmemoryPart(ip *inmemoryPart) { +// InitFromInmemoryPart initializes bsr from the given mp. +func (bsr *blockStreamReader) InitFromInmemoryPart(mp *inmemoryPart) { bsr.reset() var err error - bsr.mrs, err = unmarshalMetaindexRows(bsr.mrs[:0], ip.metaindexData.NewReader()) + bsr.mrs, err = unmarshalMetaindexRows(bsr.mrs[:0], mp.metaindexData.NewReader()) if err != nil { logger.Panicf("BUG: cannot unmarshal metaindex rows from inmemory part: %s", err) } - bsr.ph.CopyFrom(&ip.ph) - bsr.indexReader = ip.indexData.NewReader() - bsr.itemsReader = ip.itemsData.NewReader() - bsr.lensReader = ip.lensData.NewReader() + bsr.ph.CopyFrom(&mp.ph) + bsr.indexReader = mp.indexData.NewReader() + bsr.itemsReader = mp.itemsData.NewReader() + bsr.lensReader = mp.lensData.NewReader() if bsr.ph.itemsCount <= 0 { logger.Panicf("BUG: source inmemoryPart must contain at least a single item") diff --git a/lib/mergeset/block_stream_writer.go b/lib/mergeset/block_stream_writer.go index 205da28f6..46bac85a6 100644 --- a/lib/mergeset/block_stream_writer.go +++ b/lib/mergeset/block_stream_writer.go @@ -63,17 +63,17 @@ func (bsw *blockStreamWriter) reset() { bsw.mrFirstItemCaught = false } -func (bsw *blockStreamWriter) InitFromInmemoryPart(ip *inmemoryPart) { +func (bsw *blockStreamWriter) InitFromInmemoryPart(mp *inmemoryPart) { bsw.reset() // Use the minimum compression level for in-memory blocks, // since they are going to be re-compressed during the merge into file-based blocks. bsw.compressLevel = -5 // See https://github.com/facebook/zstd/releases/tag/v1.3.4 - bsw.metaindexWriter = &ip.metaindexData - bsw.indexWriter = &ip.indexData - bsw.itemsWriter = &ip.itemsData - bsw.lensWriter = &ip.lensData + bsw.metaindexWriter = &mp.metaindexData + bsw.indexWriter = &mp.indexData + bsw.itemsWriter = &mp.itemsData + bsw.lensWriter = &mp.lensData } // InitFromFilePart initializes bsw from a file-based part on the given path.