MCPcopy Index your code
hub / github.com/dgraph-io/badger / isCompactable

Method isCompactable

levels.go:419–421  ·  view source on GitHub ↗

Returns true if the non-zero level may be compacted. delSize provides the size of the tables which are currently being compacted so that we treat them as already having started being compacted (because they have been, yet their size is already counted in getTotalSize).

(delSize int64)

Source from the content-addressed store, hash-verified

417// which are currently being compacted so that we treat them as already having started being
418// compacted (because they have been, yet their size is already counted in getTotalSize).
419func (l *levelHandler) isCompactable(delSize int64) bool {
420 return l.getTotalSize()-delSize >= l.maxTotalSize
421}
422
423type compactionPriority struct {
424 level int

Callers 1

pickCompactLevelsMethod · 0.80

Calls 1

getTotalSizeMethod · 0.95

Tested by

no test coverage detected