logsm

package
v2.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogSM

type LogSM struct {
	// contains filtered or unexported fields
}

LogSM defines the Log-Structured Merge Tree

func Open

func Open(dir string, opts ...Option) (*LogSM, error)

Open the log

func (*LogSM) Close

func (x *LogSM) Close()

func (*LogSM) Delete

func (x *LogSM) Delete(key string) error

func (*LogSM) Get

func (x *LogSM) Get(key string) ([]byte, bool)

func (*LogSM) Scan

func (x *LogSM) Scan(start, end string) []stypes.KV

Scan [start, end)

func (*LogSM) Set

func (x *LogSM) Set(key string, value []byte) error

func (*LogSM) State

func (x *LogSM) State() State

type Option

type Option interface {
	Apply(*LogSM)
}

func WithDataBlockByteThreshold

func WithDataBlockByteThreshold(threshold int) Option

WithDataBlockByteThreshold sets the custom data block byte threshold

func WithL0TargetNum

func WithL0TargetNum(num int) Option

WithL0TargetNum sets a custom L0 target number

func WithLevelRatio

func WithLevelRatio(ratio int) Option

WithLevelRatio sets a custom level ratio

func WithLogger

func WithLogger(logger log.Logger) Option

WithLogger sets a custom logger

func WithMemTableSizeThreshold

func WithMemTableSizeThreshold(threshold int) Option

WithMemTableSizeThreshold sets the custom MemTable size threshold

func WithProbability

func WithProbability(probability float64) Option

WithProbability sets the custom SkipList probability

func WithSkipListMaxLevel

func WithSkipListMaxLevel(maxLevel int) Option

WithSkipListMaxLevel sets the custom SkipList max level

type OptionFunc

type OptionFunc func(*LogSM)

OptionFunc implements the Option interface.

func (OptionFunc) Apply

func (f OptionFunc) Apply(t *LogSM)

type State

type State uint32
const (
	StateInitialized State
	StateOpened
	StateClosed
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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