Documentation
¶
Index ¶
- Constants
- func Run(t *testing.T, storeCreator func() VersionStore)
- func SetupTestDB(t *testing.T, store VersionStore)
- type ImportEntry
- type Iterator
- type KVPair
- type MultiStore
- func (s *MultiStore) CacheMultiStore() types.CacheMultiStore
- func (s *MultiStore) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStore, error)
- func (s *MultiStore) CacheWrap() types.CacheWrap
- func (s *MultiStore) Close() error
- func (s *MultiStore) GetKVStore(storeKey types.StoreKey) types.KVStore
- func (s *MultiStore) GetObjKVStore(storeKey types.StoreKey) types.ObjKVStore
- func (s *MultiStore) GetStore(storeKey types.StoreKey) types.Store
- func (s *MultiStore) GetStoreType() types.StoreType
- func (s *MultiStore) LatestVersion() int64
- func (s *MultiStore) SetTracer(_ interface{}) types.MultiStore
- func (s *MultiStore) SetTracingContext(_ interface{}) types.MultiStore
- func (s *MultiStore) TracingEnabled() bool
- type Store
- func (st *Store) CacheWrap() types.CacheWrap
- func (st *Store) CacheWrapWithTrace(_ io.Writer, _ interface{}) types.CacheWrap
- func (st *Store) Delete(key []byte)
- func (st *Store) Get(key []byte) []byte
- func (st *Store) GetStoreType() types.StoreType
- func (st *Store) Has(key []byte) (exists bool)
- func (st *Store) Iterator(start, end []byte) types.Iterator
- func (st *Store) ReverseIterator(start, end []byte) types.Iterator
- func (st *Store) Set(key, value []byte)
- type StreamingService
- type VersionStore
Constants ¶
const StoreTypeVersionDB = 1000
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(t *testing.T, storeCreator func() VersionStore)
func SetupTestDB ¶
func SetupTestDB(t *testing.T, store VersionStore)
Types ¶
type ImportEntry ¶
type MultiStore ¶
type MultiStore struct {
// contains filtered or unexported fields
}
MultiStore wraps `VersionStore` to implement `MultiStore` interface.
func NewMultiStore ¶
func NewMultiStore( parent types.MultiStore, versionDB VersionStore, storeKeys map[string]*types.KVStoreKey, delegatedStoreKeys map[types.StoreKey]struct{}, ) *MultiStore
NewMultiStore returns a new versiondb `MultiStore`.
func (*MultiStore) CacheMultiStore ¶
func (s *MultiStore) CacheMultiStore() types.CacheMultiStore
CacheMultiStore implements `MultiStore` interface
func (*MultiStore) CacheMultiStoreWithVersion ¶
func (s *MultiStore) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStore, error)
CacheMultiStoreWithVersion implements `MultiStore` interface
func (*MultiStore) CacheWrap ¶
func (s *MultiStore) CacheWrap() types.CacheWrap
CacheWrap implements CacheWrapper/MultiStore/CommitStore.
func (*MultiStore) GetKVStore ¶
func (s *MultiStore) GetKVStore(storeKey types.StoreKey) types.KVStore
GetKVStore implements `MultiStore` interface
func (*MultiStore) GetObjKVStore ¶
func (s *MultiStore) GetObjKVStore(storeKey types.StoreKey) types.ObjKVStore
GetObjKVStore implements `MultiStore` interface
func (*MultiStore) GetStore ¶
func (s *MultiStore) GetStore(storeKey types.StoreKey) types.Store
GetStore implements `MultiStore` interface
func (*MultiStore) GetStoreType ¶
func (s *MultiStore) GetStoreType() types.StoreType
GetStoreType implements `MultiStore` interface.
func (*MultiStore) LatestVersion ¶
func (s *MultiStore) LatestVersion() int64
LatestVersion returns the latest version saved in versiondb
func (*MultiStore) SetTracer ¶
func (s *MultiStore) SetTracer(_ interface{}) types.MultiStore
SetTracer implements `MultiStore` interface.
func (*MultiStore) SetTracingContext ¶
func (s *MultiStore) SetTracingContext(_ interface{}) types.MultiStore
SetTracingContext implements `MultiStore` interface.
func (*MultiStore) TracingEnabled ¶
func (s *MultiStore) TracingEnabled() bool
TracingEnabled returns if tracing is enabled for the MultiStore.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store Implements types.KVStore
func NewKVStore ¶
func NewKVStore(store VersionStore, storeKey string, version *int64) *Store
func (*Store) CacheWrapWithTrace ¶
func (*Store) GetStoreType ¶
GetStoreType Implements Store.
func (*Store) ReverseIterator ¶
ReverseIterator Implements types.KVStore.
type StreamingService ¶
type StreamingService struct {
// contains filtered or unexported fields
}
StreamingService is a concrete implementation of StreamingService that accumulate the state changes in current block, writes the ordered changeset out to version storage.
func NewStreamingService ¶
func NewStreamingService(versionStore VersionStore) *StreamingService
NewStreamingService creates a new StreamingService for the provided writeDir, (optional) filePrefix, and storeKeys
func (*StreamingService) ListenCommit ¶
func (fss *StreamingService) ListenCommit(ctx context.Context, res abci.ResponseCommit, changeSet []*types.StoreKVPair) error
func (*StreamingService) ListenFinalizeBlock ¶
func (fss *StreamingService) ListenFinalizeBlock(ctx context.Context, req abci.RequestFinalizeBlock, res abci.ResponseFinalizeBlock) error
ListenFinalizeBlock satisfies the types.ABCIListener interface
type VersionStore ¶
type VersionStore interface {
GetAtVersion(storeKey string, key []byte, version *int64) ([]byte, error)
HasAtVersion(storeKey string, key []byte, version *int64) (bool, error)
IteratorAtVersion(storeKey string, start, end []byte, version *int64) (Iterator, error)
ReverseIteratorAtVersion(storeKey string, start, end []byte, version *int64) (Iterator, error)
GetLatestVersion() (int64, error)
// Persist the change set of a block,
// the `changeSet` should be ordered by (storeKey, key),
// the version should be latest version plus one.
PutAtVersion(version int64, changeSet []*types.StoreKVPair) error
// Import the initial state of the store
Import(version int64, ch <-chan ImportEntry) error
// Flush wal logs, and make the changes persistent,
// mainly for rocksdb version upgrade, sometimes the wal format is not compatible.
Flush() error
}
VersionStore is a versioned storage of a flat key-value pairs. it don't need to support merkle proof, so could be implemented in a much more efficient way. `nil` version means the latest version.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package extsort implements external sorting algorithm, it has several different design choices compared with alternatives like https://github.com/lanrat/extsort:
|
Package extsort implements external sorting algorithm, it has several different design choices compared with alternatives like https://github.com/lanrat/extsort: |