historydb

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2018 License: Apache-2.0 Imports: 6 Imported by: ? 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

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

CompositeKeySep is a nil byte used as a separator between different components of a composite key

Functions

func ConstructCompositeHistoryKey

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

ConstructCompositeHistoryKey builds the History Key of namespace~key~blocknum~trannum using an order preserving encoding so that history query results are ordered by height

func ConstructPartialCompositeHistoryKey

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

ConstructPartialCompositeHistoryKey builds a partial History Key namespace~key~ for use in history key range queries

func SplitCompositeHistoryKey

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

SplitCompositeHistoryKey splits the key bytes using a separator

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 - an interface that a history database should implement

type HistoryDBProvider

type HistoryDBProvider interface {
	// GetDBHandle returns a handle to a HistoryDB
	GetDBHandle(id string) (HistoryDB, error)
	// Close closes all the HistoryDB instances and releases any resources held by HistoryDBProvider
	Close()
}

HistoryDBProvider provides an instance of a history DB

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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