lsm

package
v0.0.67 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompactCallback

type CompactCallback func(r arrow.Record) bool

type CompactStats

type CompactStats struct {
	OldSize             uint64
	CompactedNodesCount int
	Elapsed             time.Duration
}

type Node

type Node[T any] struct {
	// contains filtered or unexported fields
}

func (*Node[T]) Iterate

func (n *Node[T]) Iterate(f func(*Node[T]) bool)

func (*Node[T]) Prepend

func (n *Node[T]) Prepend(part T) *Node[T]

type Option

type Option func(*Options)

func WithCompactSize

func WithCompactSize(size uint64) Option

func WithTTL

func WithTTL(ttl time.Duration) Option

type Options

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

func DefaultLSMOptions

func DefaultLSMOptions() Options

type PartStore

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

PartStore is in memory storage of parts

func NewPartStore

func NewPartStore(mem memory.Allocator) *PartStore

func (*PartStore) Add

func (p *PartStore) Add(r *RecordPart)

func (*PartStore) Compact

func (p *PartStore) Compact(f func(r arrow.Record)) (stats CompactStats)

func (*PartStore) Release

func (p *PartStore) Release()

func (*PartStore) Reset

func (p *PartStore) Reset()

func (*PartStore) Scan

func (p *PartStore) Scan(start, end int64,
	compiled []*filters.CompiledFilter,
	projected []string) arrow.Record

func (*PartStore) Size

func (p *PartStore) Size() uint64

type RecordNode

type RecordNode = Node[index.Part]

type RecordPart

type RecordPart struct {
	index.Full
	// contains filtered or unexported fields
}

func NewPart

func NewPart(r arrow.Record, idx index.Full) *RecordPart

func (*RecordPart) ID

func (r *RecordPart) ID() string

func (*RecordPart) Record

func (r *RecordPart) Record() arrow.Record

func (*RecordPart) Release

func (r *RecordPart) Release()

func (*RecordPart) Size

func (r *RecordPart) Size() uint64

type RecordSource

type RecordSource interface {
	Record(f func(arrow.Record) error) error
}

type Tree

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

func NewTree

func NewTree(mem memory.Allocator, indexer index.Index, opts ...Option) *Tree

func (*Tree) Add

func (lsm *Tree) Add(r arrow.Record) error

func (*Tree) Compact

func (lsm *Tree) Compact(onCompact CompactCallback)

func (*Tree) Restore

func (lsm *Tree) Restore(source RecordSource) error

func (*Tree) Scan

func (lsm *Tree) Scan(ctx context.Context, start, end int64, fs *v1.Filters) (arrow.Record, error)

func (*Tree) Size

func (lsm *Tree) Size() uint64

Size returns the size in bytes of records+index in the lsm tree. This only accounts for active data.

Cold data is still scanned by lsm tree but no account is about about its size.

func (*Tree) Start

func (lsm *Tree) Start(ctx context.Context)

Jump to

Keyboard shortcuts

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