tidb: github.com/pingcap/tidb/kv/memdb Index | Files

package memdb

import "github.com/pingcap/tidb/kv/memdb"

Index

Package Files

arena.go iterator.go memdb.go

type Iterator Uses

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

Iterator iterates the entries in the DB.

func (*Iterator) Key Uses

func (it *Iterator) Key() []byte

Key returns the key at the current position.

func (*Iterator) Next Uses

func (it *Iterator) Next()

Next moves the iterator to the next entry.

func (*Iterator) Prev Uses

func (it *Iterator) Prev()

Prev moves the iterator to the previous entry.

func (*Iterator) Seek Uses

func (it *Iterator) Seek(seekKey []byte)

Seek locates the iterator to the first entry with a key >= seekKey.

func (*Iterator) SeekForExclusivePrev Uses

func (it *Iterator) SeekForExclusivePrev(target []byte)

SeekForExclusivePrev locates the iterator to the last entry with key < target.

func (*Iterator) SeekForPrev Uses

func (it *Iterator) SeekForPrev(target []byte)

SeekForPrev locates the iterator to the last entry with key <= target.

func (*Iterator) SeekToFirst Uses

func (it *Iterator) SeekToFirst()

SeekToFirst locates the iterator to the first entry.

func (*Iterator) SeekToLast Uses

func (it *Iterator) SeekToLast()

SeekToLast locates the iterator to the last entry.

func (*Iterator) Valid Uses

func (it *Iterator) Valid() bool

Valid returns true if the iterator is positioned at a valid node.

func (*Iterator) Value Uses

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

Value returns value.

type Sandbox Uses

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

Sandbox is a space to keep pending kvs.

func NewSandbox Uses

func NewSandbox() *Sandbox

NewSandbox create a new Sandbox.

func (*Sandbox) Derive Uses

func (sb *Sandbox) Derive() *Sandbox

Derive derive a new sandbox to buffer a batch of modifactions.

func (*Sandbox) Discard Uses

func (sb *Sandbox) Discard()

Discard discards all kvs in this sandbox. It is safe to discard a flushed sandbox, and it is recommend to call discard using defer to maintain correct state of parent.

func (*Sandbox) Flush Uses

func (sb *Sandbox) Flush() int

Flush flushes all kvs into parent sandbox.

func (*Sandbox) Get Uses

func (sb *Sandbox) Get(key []byte) []byte

Get returns value for key in this sandbox's space.

func (*Sandbox) GetParent Uses

func (sb *Sandbox) GetParent() *Sandbox

GetParent returns the parent sandbox.

func (*Sandbox) Len Uses

func (sb *Sandbox) Len() int

Len returns the number of entries in the DB.

func (*Sandbox) NewIterator Uses

func (sb *Sandbox) NewIterator() Iterator

NewIterator returns a new Iterator for the lock store.

func (*Sandbox) Put Uses

func (sb *Sandbox) Put(key, value []byte)

Put inserts kv into this sandbox.

func (*Sandbox) Size Uses

func (sb *Sandbox) Size() int

Size returns sum of keys and values length. Note that deleted key/value will not be accounted for, but it will still consume the buffer, since the buffer is append only.

Package memdb imports 4 packages (graph) and is imported by 4 packages. Updated 2020-06-01. Refresh now. Tools for package owners.