merging

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iterator

type Iterator interface {
	Next()
	Valid() bool
	Key() []byte
	Value() []byte
	KeyCopy(dst []byte) []byte
	ValueCopy(dst []byte) []byte
	Close() error
	Error() error
	Domain() (start, end []byte)
}

Iterator represents a generic iterator that yields key-value pairs. Key/Value are views, valid until the next Next()/Close().

func NewMergingIterator

func NewMergingIterator(sources []IteratorSource, start, end []byte) Iterator

type IteratorSource

type IteratorSource struct {
	Iter     iterator.UnsafeIterator
	Priority int
}

IteratorSource wraps an internal UnsafeIterator with a priority level.

type MergingIterator

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

MergingIterator merges multiple sorted iterators.

func (*MergingIterator) Close

func (mi *MergingIterator) Close() error

func (*MergingIterator) Domain

func (mi *MergingIterator) Domain() (start, end []byte)

func (*MergingIterator) Error

func (mi *MergingIterator) Error() error

func (*MergingIterator) Key

func (mi *MergingIterator) Key() []byte

func (*MergingIterator) KeyCopy

func (mi *MergingIterator) KeyCopy(dst []byte) []byte

func (*MergingIterator) Next

func (mi *MergingIterator) Next()

func (*MergingIterator) Valid

func (mi *MergingIterator) Valid() bool

func (*MergingIterator) Value

func (mi *MergingIterator) Value() []byte

func (*MergingIterator) ValueCopy

func (mi *MergingIterator) ValueCopy(dst []byte) []byte

type TwoWayMerger

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

TwoWayMerger implements MergingIterator for two sources (Memtable and Disk). It avoids heap overhead for the common case.

func NewTwoWayMerger

func NewTwoWayMerger(src1, src2 iterator.UnsafeIterator, start, end []byte) *TwoWayMerger

func (*TwoWayMerger) Close

func (m *TwoWayMerger) Close() error

func (*TwoWayMerger) Domain

func (m *TwoWayMerger) Domain() (start, end []byte)

func (*TwoWayMerger) Error

func (m *TwoWayMerger) Error() error

func (*TwoWayMerger) Key

func (m *TwoWayMerger) Key() []byte

func (*TwoWayMerger) KeyCopy

func (m *TwoWayMerger) KeyCopy(dst []byte) []byte

func (*TwoWayMerger) Next

func (m *TwoWayMerger) Next()

func (*TwoWayMerger) Valid

func (m *TwoWayMerger) Valid() bool

func (*TwoWayMerger) Value

func (m *TwoWayMerger) Value() []byte

func (*TwoWayMerger) ValueCopy

func (m *TwoWayMerger) ValueCopy(dst []byte) []byte

Jump to

Keyboard shortcuts

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