memtable

package
v0.0.0-...-d3d32da Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RED   color = 0
	BLACK color = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Memtable

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

func NewMemtable

func NewMemtable() *Memtable

Creates a new instance of a Memtable

func (*Memtable) Bytes

func (memtable *Memtable) Bytes() int64

func (*Memtable) Get

func (memtable *Memtable) Get(key []byte) ([]byte, bool)

Returns the value for a given key. The second return value signals whether the key was found or not found.

func (*Memtable) Iterator

func (memtable *Memtable) Iterator(start, end []byte) common.Iterator

Creates a new bounded iterator for the current state of the memtable. Since the memtable is backed by a persistent data structure, this reflects a point in time snapshot of the memtable.

func (*Memtable) UnboundedIterator

func (memtable *Memtable) UnboundedIterator() common.Iterator

Creates a new unbounded iterator for the current state of the memtable. Since the memtable is backed by a persistent data structure, this reflects a point in time snapshot of the memtable.

func (*Memtable) Write

func (memtable *Memtable) Write(key, value []byte)

Writes a key/value pair to the memtable. Returns a new instance of a memtable with the key value pair added.

Jump to

Keyboard shortcuts

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