hive_adaptor

package
v0.0.0-...-2b1eae4 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package hive_adaptor contains adaptor interfaces with the key/value interfaces implemented in the `hive.go` repository.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HiveBatchedUpdater

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

HiveBatchedUpdater implements buffering and flush updates in batches, both k/v pairs and trie. Dramatically improves speed

func NewHiveBatchedUpdater

func NewHiveBatchedUpdater(kvs kvstore.KVStore, model trie.CommitmentModel, triePrefix, valueStorePrefix []byte, optimizeKeyCommitments bool) (*HiveBatchedUpdater, error)

NewHiveBatchedUpdater creates new batch updater with the hive.go batch as a backend

func (*HiveBatchedUpdater) Commit

func (a *HiveBatchedUpdater) Commit() error

Commit commits the tries cache and persist mutations to the batch. Then it commits the whole batch as an atomic update to the underlying kvstore

func (*HiveBatchedUpdater) Update

func (a *HiveBatchedUpdater) Update(key []byte, value []byte)

Update adds key values store both to the batch and to the trie

type HiveKVStoreAdaptor

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

HiveKVStoreAdaptor maps a partition of the Hive KVStore to trie_go.KVStore

func NewHiveKVStoreAdaptor

func NewHiveKVStoreAdaptor(kvs kvstore.KVStore, prefix []byte) *HiveKVStoreAdaptor

NewHiveKVStoreAdaptor creates a new KVStore as a partition of hive.go KVStore

func (*HiveKVStoreAdaptor) Get

func (kvs *HiveKVStoreAdaptor) Get(key []byte) []byte

func (*HiveKVStoreAdaptor) Has

func (kvs *HiveKVStoreAdaptor) Has(key []byte) bool

func (*HiveKVStoreAdaptor) Iterate

func (kvs *HiveKVStoreAdaptor) Iterate(fun func(k []byte, v []byte) bool)

func (*HiveKVStoreAdaptor) Set

func (kvs *HiveKVStoreAdaptor) Set(key, value []byte)

Jump to

Keyboard shortcuts

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