memtable

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFlushThreshold = errors.New("memtable: flush threshold has been reached")
	ErrKeyNotFound    = errors.New("memtable: key not found")
	ErrFoundTombstone = errors.New("memtable: found tombstone; entry was deleted")
)
View Source
var Tombstone = []byte(nil)

Functions

This section is empty.

Types

type Memtable

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

func OpenMemtable

func OpenMemtable(c *MemtableConfig) (*Memtable, error)

func (*Memtable) Close

func (mt *Memtable) Close() error

func (*Memtable) CloseAndRemove

func (mt *Memtable) CloseAndRemove() error

func (*Memtable) Del

func (mt *Memtable) Del(k string) error

func (*Memtable) Get

func (mt *Memtable) Get(k string) (*binary.Entry, error)

func (*Memtable) GetConfig

func (mt *Memtable) GetConfig() *MemtableConfig

func (*Memtable) Has

func (mt *Memtable) Has(k string) bool

func (*Memtable) Len

func (mt *Memtable) Len() int

func (*Memtable) Put

func (mt *Memtable) Put(e *binary.Entry) error

func (*Memtable) PutBatch

func (mt *Memtable) PutBatch(batch *binary.Batch) error

func (*Memtable) Reset

func (mt *Memtable) Reset() error

func (*Memtable) ResetWorksWithTimer

func (mt *Memtable) ResetWorksWithTimer() error

func (*Memtable) Scan

func (mt *Memtable) Scan(iter func(me rbtree.RBEntry) bool)

func (*Memtable) ShouldFlush

func (mt *Memtable) ShouldFlush() bool

func (*Memtable) Size

func (mt *Memtable) Size() int64

func (*Memtable) Sync

func (mt *Memtable) Sync() error

type MemtableConfig

type MemtableConfig struct {
	BasePath       string // base storage path
	FlushThreshold int64  // memtable flush threshold in KB
	SyncOnWrite    bool   // perform sync every time an entry is write
}

type MemtableEntry

type MemtableEntry = memtableEntry

Jump to

Keyboard shortcuts

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