lib/mergeset: rename misleading mergeSmallParts to mergeExistingParts

This commit is contained in:
Aliaksandr Valialkin 2019-09-19 21:48:14 +03:00
parent ebbef20535
commit bf8505353a

View File

@ -477,7 +477,7 @@ func (tb *Table) mergeRawItemsBlocks(blocksToMerge []*inmemoryBlock) {
} }
// The added part exceeds maxParts count. Assist with merging other parts. // The added part exceeds maxParts count. Assist with merging other parts.
err := tb.mergeSmallParts(false) err := tb.mergeExistingParts(false)
if err == nil { if err == nil {
atomic.AddUint64(&tb.assistedMerges, 1) atomic.AddUint64(&tb.assistedMerges, 1)
continue continue
@ -569,7 +569,7 @@ func (tb *Table) startPartMergers() {
} }
} }
func (tb *Table) mergeSmallParts(isFinal bool) error { func (tb *Table) mergeExistingParts(isFinal bool) error {
maxItems := tb.maxOutPartItems() maxItems := tb.maxOutPartItems()
if maxItems > maxItemsPerPart { if maxItems > maxItemsPerPart {
maxItems = maxItemsPerPart maxItems = maxItemsPerPart
@ -593,7 +593,7 @@ func (tb *Table) partMerger() error {
isFinal := false isFinal := false
t := time.NewTimer(sleepTime) t := time.NewTimer(sleepTime)
for { for {
err := tb.mergeSmallParts(isFinal) err := tb.mergeExistingParts(isFinal)
if err == nil { if err == nil {
// Try merging additional parts. // Try merging additional parts.
sleepTime = minMergeSleepTime sleepTime = minMergeSleepTime