resultkvdb

package
v2.3.6 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package resultkvdb package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResultKvDB

type ResultKvDB struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ResultKvDB provider an implementation of `historydb.HistoryDB` @Description: This implementation provides a key-value based data model

func NewResultKvDB

func NewResultKvDB(chainId string, handle protocol.DBHandle, logger protocol.Logger,
	storeConfig *conf.StorageConfig) *ResultKvDB

NewResultKvDB construct ResultKvDB @Description: @param chainId @param handle @param logger @param storeConfig @return *ResultKvDB

func (*ResultKvDB) Close

func (h *ResultKvDB) Close()

Close is used to close database @Description: @receiver h

func (*ResultKvDB) CommitBlock

func (h *ResultKvDB) CommitBlock(blockInfo *serialization.BlockWithSerializedInfo, isCache bool) error

CommitBlock commits the block rwsets in an atomic operation @Description: @receiver h @param blockInfo @param isCache @return error

func (*ResultKvDB) GetLastSavepoint

func (h *ResultKvDB) GetLastSavepoint() (uint64, error)

GetLastSavepoint returns the last block height @Description: @receiver h @return uint64 @return error

func (*ResultKvDB) GetRWSetIndex added in v2.2.0

func (h *ResultKvDB) GetRWSetIndex(txId string) (*storePb.StoreInfo, error)

GetRWSetIndex returns the offset of the block in the file @Description: @receiver h @param txId @return *storePb.StoreInfo @return error

func (*ResultKvDB) GetTxRWSet

func (h *ResultKvDB) GetTxRWSet(txId string) (*commonPb.TxRWSet, error)

GetTxRWSet returns an txRWSet for given txId, or returns nil if none exists. @Description: @receiver h @param txId @return *commonPb.TxRWSet @return error

func (*ResultKvDB) InitGenesis

func (h *ResultKvDB) InitGenesis(genesisBlock *serialization.BlockWithSerializedInfo) error

InitGenesis init genesis block @Description: @receiver h @param genesisBlock @return error

func (*ResultKvDB) RestoreBlocks

func (h *ResultKvDB) RestoreBlocks(blockInfos []*serialization.BlockWithSerializedInfo) error

RestoreBlocks restore block info,put it into kv db,used by archive module @Description: @receiver h @param blockInfos @return error

func (*ResultKvDB) ShrinkBlocks

func (h *ResultKvDB) ShrinkBlocks(txIdsMap map[uint64][]string, _ uint64, _ string) error

ShrinkBlocks archive old blocks rwsets in an atomic operation @Description: @receiver h @param txIdsMap @return error

Jump to

Keyboard shortcuts

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