internal

package
v0.46.8 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCacheMergeIterator

func NewCacheMergeIterator(parent, cache types.Iterator, ascending bool) *cacheMergeIterator

func NewMemIterator

func NewMemIterator(start, end []byte, items *BTree, deleted map[string]struct{}, ascending bool) *memIterator

Types

type BTree

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

BTree implements the sorted cache for cachekv store, we don't use MemDB here because cachekv is used extensively in sdk core path, we need it to be as fast as possible, while `MemDB` is mainly used as a mocking db in unit tests.

We choose tidwall/btree over google/btree here because it provides API to implement step iterator directly.

func NewBTree

func NewBTree() *BTree

NewBTree creates a wrapper around `btree.BTreeG`.

func (*BTree) Delete

func (bt *BTree) Delete(key []byte)

func (*BTree) Get

func (bt *BTree) Get(key []byte) []byte

func (*BTree) Iterator

func (bt *BTree) Iterator(start, end []byte) (*memIterator, error)

func (*BTree) ReverseIterator

func (bt *BTree) ReverseIterator(start, end []byte) (*memIterator, error)

func (*BTree) Set

func (bt *BTree) Set(key, value []byte)

Jump to

Keyboard shortcuts

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