idx file sync before compaction

This commit is contained in:
Chris Lu
2020-03-20 23:38:46 -07:00
parent 3505b06023
commit cbfe31a9a8
2 changed files with 12 additions and 4 deletions

View File

@@ -30,6 +30,7 @@ type NeedleMapper interface {
DeletedCount() int
MaxFileKey() NeedleId
IndexFileSize() uint64
Sync() error
}
type baseNeedleMapper struct {
@@ -59,3 +60,7 @@ func (nm *baseNeedleMapper) appendToIndexFile(key NeedleId, offset Offset, size
_, err := nm.indexFile.Write(bytes)
return err
}
func (nm *baseNeedleMapper) Sync() error {
return nm.indexFile.Sync()
}