compaction

package
v0.0.0-...-3976360 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
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

func (registry *Registry) Complete(level int)

Complete removes a existing compaction registration for given level. It panic if there is no such compaction.

func (*Registry) Concurrency

func (registry *Registry) Concurrency() int

Concurrency returns the number of concurrent ongoing compactions currently.

func (*Registry) Corrupt

func (registry *Registry) Corrupt(level int)

Corrupt marks compaction for given level as corrupted. Corrupted compaction doesn't contribute to concurrency, but it does contribute to NextFileNumber.

func (*Registry) ExpandTo

func (registry *Registry) ExpandTo(level, target int) int

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

func (registry *Registry) NextFileNumber(defaultValue uint64) uint64

NextFileNumber returns minimum NextFileNumber among all compactions registered or defaultValue if there is no ongoing compaction.

func (*Registry) Recap

func (registry *Registry) Recap(cap int)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL