kvmvccdb

package
v1.66.3 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: BSD-3-Clause Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ErrStateHashLost means err happened when query with StateHash
	ErrStateHashLost = errors.New("ErrStateHashLost")
)

Functions

func DisableLog

func DisableLog()

DisableLog disable log output

func New

func New(cfg *types.Store, sub []byte, chain33cfg *types.Chain33Config) queue.Module

New construct KVMVCCStore module

func SetLogLevel

func SetLogLevel(level string)

SetLogLevel set log level

Types

type KVMVCCStore

type KVMVCCStore struct {
	*drivers.BaseStore
	// contains filtered or unexported fields
}

KVMVCCStore provide kvmvcc store interface implementation

func (*KVMVCCStore) Close

func (mvccs *KVMVCCStore) Close()

Close the KVMVCCStore module

func (*KVMVCCStore) Commit

func (mvccs *KVMVCCStore) Commit(req *types.ReqHash) ([]byte, error)

Commit kvs in the mem of KVMVCCStore module to state db and return the StateHash

func (*KVMVCCStore) CommitUpgrade

func (mvccs *KVMVCCStore) CommitUpgrade(req *types.ReqHash) ([]byte, error)

CommitUpgrade kvs in the mem of KVMVCCStore module to state db and return the StateHash

func (*KVMVCCStore) Del

func (mvccs *KVMVCCStore) Del(req *types.StoreDel) ([]byte, error)

Del set kvs to nil with StateHash

func (*KVMVCCStore) Get

func (mvccs *KVMVCCStore) Get(datas *types.StoreGet) [][]byte

Get kvs with statehash from KVMVCCStore

func (*KVMVCCStore) IterateRangeByStateHash

func (mvccs *KVMVCCStore) IterateRangeByStateHash(statehash []byte, start []byte, end []byte, ascending bool, fn func(key, value []byte) bool)

IterateRangeByStateHash travel with Prefix by StateHash to get the latest version kvs.

func (*KVMVCCStore) MemSet

func (mvccs *KVMVCCStore) MemSet(datas *types.StoreSet, sync bool) ([]byte, error)

MemSet set kvs to the mem of KVMVCCStore module and return the StateHash

func (*KVMVCCStore) MemSetUpgrade

func (mvccs *KVMVCCStore) MemSetUpgrade(datas *types.StoreSet, sync bool) ([]byte, error)

MemSetUpgrade set kvs to the mem of KVMVCCStore module and return the StateHash

func (*KVMVCCStore) ProcEvent

func (mvccs *KVMVCCStore) ProcEvent(msg *queue.Message)

ProcEvent handles supported events

func (*KVMVCCStore) Rollback

func (mvccs *KVMVCCStore) Rollback(req *types.ReqHash) ([]byte, error)

Rollback kvs in the mem of KVMVCCStore module and return the StateHash

func (*KVMVCCStore) Set

func (mvccs *KVMVCCStore) Set(datas *types.StoreSet, sync bool) ([]byte, error)

Set kvs with statehash to KVMVCCStore

Jump to

Keyboard shortcuts

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