historydb

package
v0.0.0-...-523a819 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CompositeKeySep = []byte{0x00}

compositekeysep是一个零字节,用作复合键不同组件之间的分隔符。

Functions

func ConstructCompositeHistoryKey

func ConstructCompositeHistoryKey(ns string, key string, blocknum uint64, trannum uint64) []byte

constructcompositehistorykey生成命名空间~key~blocknum~trannum的历史键 使用保留顺序的编码,以便按高度排序历史查询结果

func ConstructPartialCompositeHistoryKey

func ConstructPartialCompositeHistoryKey(ns string, key string, endkey bool) []byte

constructPartialCompositeHistoryKey生成部分历史键命名空间~key~ 用于历史键范围查询

func SplitCompositeHistoryKey

func SplitCompositeHistoryKey(bytesToSplit []byte, separator []byte) ([]byte, []byte)

SplitCompositeHistoryKey使用分隔符拆分键字节

Types

type HistoryDB

type HistoryDB interface {
	NewHistoryQueryExecutor(blockStore blkstorage.BlockStore) (ledger.HistoryQueryExecutor, error)
	Commit(block *common.Block) error
	GetLastSavepoint() (*version.Height, error)
	ShouldRecover(lastAvailableBlock uint64) (bool, uint64, error)
	CommitLostBlock(blockAndPvtdata *ledger.BlockAndPvtData) error
}

HistoryDB-历史数据库应该实现的接口

type HistoryDBProvider

type HistoryDBProvider interface {
	//GetDBHandle返回HistoryDB的句柄
	GetDBHandle(id string) (HistoryDB, error)
	//关闭关闭所有HistoryDB实例并释放HistoryDBProvider持有的任何资源
	Close()
}

HistoryDBProvider提供历史数据库的实例

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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