memtable

package
v0.0.0-...-1be9e8e Latest Latest
Warning

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

Go to latest
Published: May 13, 2018 License: Apache-2.0 Imports: 7 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 struct {
	// contains filtered or unexported fields
}

Iterator iterates entries in the memtable in ascending key order. Close() must be called after use.

func (*Iterator) Close

func (i *Iterator) Close()

Close closes the iterator.

func (*Iterator) Key

func (i *Iterator) Key() string

Key returns the current key.

func (*Iterator) Next

func (i *Iterator) Next() bool

Next advances the iterator. Returns true if there is a next value.

func (*Iterator) Timestamp

func (i *Iterator) Timestamp() int64

Timestamp returns the current timestamp.

func (*Iterator) Value

func (i *Iterator) Value() []byte

Value returns the current value.

type Memtable

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

Memtable is an in-memory sorted table of (key, timestamp) -> values. keys are sorted ascending, timestamps descending.

func New

func New(seqNo int64) *Memtable

func (*Memtable) Find

func (m *Memtable) Find(key string) (value []byte, found bool)

Find returns value of key at largest timestamp, which could be nil for a deletion marker.

func (*Memtable) Insert

func (m *Memtable) Insert(seqNo int64, key string, timestamp int64, value []byte)

Insert inserts (key, timestamp, value) into the memtable. Requires that (key, timestamp) does not already exist.

func (*Memtable) NewIterator

func (m *Memtable) NewIterator() *Iterator

NewIterator creates an iterator for this memtable.

func (*Memtable) SequenceUpper

func (m *Memtable) SequenceUpper() int64

SequenceUpper returns the largest sequence number applied.

func (*Memtable) SizeBytes

func (m *Memtable) SizeBytes() int64

SizeBytes returns the approximate memory used by this memtable.

Jump to

Keyboard shortcuts

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