MCPcopy
hub / github.com/benbjohnson/litestream / PrevLevel

Method PrevLevel

compaction_level.go:97–102  ·  view source on GitHub ↗

PrevLevel returns the previous compaction level. Returns -1 if there is no previous level.

(level int)

Source from the content-addressed store, hash-verified

95// PrevLevel returns the previous compaction level.
96// Returns -1 if there is no previous level.
97func (a CompactionLevels) PrevLevel(level int) int {
98 if level == SnapshotLevel {
99 return a.MaxLevel()
100 }
101 return level - 1
102}
103
104// NextLevel returns the next compaction level.
105// Returns -1 if there is no next level.

Callers 1

CompactDBMethod · 0.80

Calls 1

MaxLevelMethod · 0.95

Tested by

no test coverage detected