internal

package
v0.47.13 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 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

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) Copy added in v0.45.13

func (bt BTree) Copy() BTree

Copy the tree. This is a copy-on-write operation and is very fast because it only performs a shadowed copy.

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) (types.Iterator, error)

func (BTree) ReverseIterator

func (bt BTree) ReverseIterator(start, end []byte) (types.Iterator, 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