internal

package
v0.48.86 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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