Documentation ¶
Index ¶
- Constants
- type Registration
- type Registry
- func (registry *Registry) Complete(level int)
- func (registry *Registry) Concurrency() int
- func (registry *Registry) Corrupt(level int)
- func (registry *Registry) ExpandTo(level, target int) int
- func (registry *Registry) NextFileNumber(defaultValue uint64) uint64
- func (registry *Registry) Recap(cap int)
- func (registry *Registry) Register(level, target int) *Registration
Constants ¶
const ( // MaxCompactionConcurrency is a cap for Registry which enforce no // concurrent compaction limitation. MaxCompactionConcurrency = -1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registration ¶
type Registration struct { NextFileNumber uint64 // contains filtered or unexported fields }
Registration represents an registered compaction.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry records all ongoing compaction registration.
func (*Registry) Complete ¶
Complete removes a existing compaction registration for given level. It panic if there is no such compaction.
func (*Registry) Concurrency ¶
Concurrency returns the number of concurrent ongoing compactions currently.
func (*Registry) Corrupt ¶
Corrupt marks compaction for given level as corrupted. Corrupted compaction doesn't contribute to concurrency, but it does contribute to NextFileNumber.
func (*Registry) ExpandTo ¶
ExpandTo tries to expand target level of a existing compaction at given level to target. It panic if there is no such compaction.
func (*Registry) NextFileNumber ¶
NextFileNumber returns minimum NextFileNumber among all compactions registered or defaultValue if there is no ongoing compaction.
func (*Registry) Recap ¶
Recap reset max concurrent compactions allowed. If cap <= 0, there will be no such limitation. This limitation doesn't cancel existing compactions, it just prevent future compaction registration to beyond this limitation.
func (*Registry) Register ¶
func (registry *Registry) Register(level, target int) *Registration
Register tries to register a new compaction for given level range [level, target], it returns true if this compaction doesn't conflict with existing registrations, false otherwise.