Do actual batch sizing for badger

This commit is contained in:
DataHoarder 2022-02-04 11:52:18 +01:00
parent 291b0ca96c
commit a1afa6fbd6

View file

@ -281,11 +281,13 @@ func (c *AppendConverter) ConvertToBadger(s *specializedstore.BadgerStore, batch
l = nrecords
}
records := make([]panako.StoreRecord, 0, int64(c.resourceIndex[i].length)*splitSize)
for _, control := range c.resourceIndex[i:l] {
records := c.ReadRecords(control.resourceId, control.recordsStartIndex, int64(control.length))
s.StorePanakoPrints(records)
records = append(records, c.ReadRecords(control.resourceId, control.recordsStartIndex, int64(control.length))...)
atomic.AddInt64(&ts.processed, int64(len(records))+c.controlSize)
}
s.StorePanakoPrints(records)
}
}()