dbutils

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const LockSuffix = ".lock"
View Source
const ObjectMemUnit = mpool.MB * 64

Variables

This section is empty.

Functions

func FormatMemStats

func FormatMemStats(memstats runtime.MemStats) string

func MakeDefaultSmallPool added in v1.0.0

func MakeDefaultSmallPool(name string) *containers.VectorPool

func MakeDefaultTransientPool

func MakeDefaultTransientPool(name string) *containers.VectorPool

func MakeLockFileName

func MakeLockFileName(dirname string, name string) string

func PrintMemStats

func PrintMemStats()

Types

type Runtime

type Runtime struct {
	Now        func() types.TS
	VectorPool struct {
		Small     *containers.VectorPool
		Transient *containers.VectorPool
	}

	Throttle *Throttle

	Fs *objectio.ObjectFS

	TransferTable   *model.HashPageTable
	TransferDelsMap *model.TransDelsForBlks
	Scheduler       tasks.TaskScheduler

	Options *options.Options

	Logtail struct {
		CompactStats stats.Counter
	}
}

func NewRuntime

func NewRuntime(opts ...RuntimeOption) *Runtime

func (*Runtime) ExportLogtailStats added in v1.0.0

func (r *Runtime) ExportLogtailStats() string

func (*Runtime) PrintVectorPoolUsage

func (r *Runtime) PrintVectorPoolUsage()

type RuntimeOption

type RuntimeOption func(*Runtime)

func WithRuntimeObjectFS

func WithRuntimeObjectFS(fs *objectio.ObjectFS) RuntimeOption

func WithRuntimeOptions

func WithRuntimeOptions(opts *options.Options) RuntimeOption

func WithRuntimeScheduler

func WithRuntimeScheduler(s tasks.TaskScheduler) RuntimeOption

func WithRuntimeSmallPool added in v1.0.0

func WithRuntimeSmallPool(vp *containers.VectorPool) RuntimeOption

func WithRuntimeThrottle

func WithRuntimeThrottle(t *Throttle) RuntimeOption

func WithRuntimeTransferTable

func WithRuntimeTransferTable(tt *model.HashPageTable) RuntimeOption

func WithRuntimeTransientPool

func WithRuntimeTransientPool(vp *containers.VectorPool) RuntimeOption

type Throttle

type Throttle struct {
	Compaction struct {
		// coarse grained throttle
		ActiveTasks         atomic.Int32
		MaxActiveTasksLimit int32

		MemUsed         atomic.Int64 // to be used in the future
		MaxMemUsedLimit int64        // to be used in the future
	}
}

func NewThrottle

func NewThrottle(opts ...ThrottleOption) *Throttle

func (*Throttle) AcquireCompactionQuota

func (t *Throttle) AcquireCompactionQuota()

func (*Throttle) CanCompact

func (t *Throttle) CanCompact() bool

coarse grained throttle check

func (*Throttle) ReleaseCompactionQuota

func (t *Throttle) ReleaseCompactionQuota()

func (*Throttle) String

func (t *Throttle) String() string

func (*Throttle) TryApplyCompactionTask

func (t *Throttle) TryApplyCompactionTask() (ok bool)

only used for fine grained throttle

type ThrottleOption

type ThrottleOption func(*Throttle)

func WithThrottleCompactionMaxMemUsedLimit

func WithThrottleCompactionMaxMemUsedLimit(limit int64) ThrottleOption

func WithThrottleCompactionMaxTasksLimit

func WithThrottleCompactionMaxTasksLimit(limit int32) ThrottleOption

Jump to

Keyboard shortcuts

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