use bytebuffer for interval list

This commit is contained in:
Chris Lu
2020-10-21 19:29:51 -07:00
parent bd103c143a
commit 9884dfc369
4 changed files with 61 additions and 28 deletions

View File

@@ -54,7 +54,7 @@ func (pages *ContinuousDirtyPages) AddPage(offset int64, data []byte) {
pages.intervals.AddInterval(data, offset)
if pages.intervals.TotalSize() > pages.f.wfs.option.ChunkSizeLimit {
if pages.intervals.TotalSize() >= pages.f.wfs.option.ChunkSizeLimit {
pages.saveExistingLargestPageToStorage()
}
@@ -93,6 +93,8 @@ func (pages *ContinuousDirtyPages) saveExistingLargestPageToStorage() (hasSavedD
pages.saveToStorage(maxList.ToReader(), maxList.Offset(), chunkSize)
maxList.Destroy()
return true
}