memtable

package
v0.0.0-...-80bddaf Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Key string
	Value
}

type Iterator

type Iterator interface {
	// Next advances the iterator to the next item and returns true if there is a next item. Returns false if there are no more items.
	Next() bool

	// Data returns the current item without advancing the iterator.
	Data() Data

	// Error returns the error encountered during iteration, if any. io.EOF is returned when the iteration is complete.
	Error() error
}

type MapIterator

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

func (*MapIterator) Data

func (it *MapIterator) Data() Data

func (*MapIterator) Error

func (it *MapIterator) Error() error

func (*MapIterator) Next

func (it *MapIterator) Next() bool

type Recoverable

type Recoverable interface {
	SetRecoveryMode(enabled bool)
}

Recoverable is implemented by MemTables that can be put into recovery mode. In recovery mode, the MemTable should not trigger flushes or panic on writes if full.

type Table

type Table interface {
	Put(recordType db.RecordType, key, value string)
	Get(key string) (string, bool)
	GetPrefix(prefix string) map[string]string
	// IsFull returns true if the memtable is full and cannot accept more writes
	IsFull() bool
	Delete(key string) error
	// Size returns the current size of the memtable in bytes
	Size() uint32
	Iterator() Iterator
}

func NewTable

func NewTable(tableType Type) Table

type Type

type Type int
const (
	MapType Type = iota
)

type Value

type Value struct {
	RecordType db.RecordType
	Value      string
}

Jump to

Keyboard shortcuts

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