Documentation
¶
Index ¶
- func NewDeletedItem(index int, incarnation int) *valueItem
- func NewEstimateItem(index int, incarnation int) *valueItem
- func NewIterationTracker(startKey, endKey []byte, ascending bool, writeset WriteSet) iterationTracker
- func NewMVSMergeIterator(parent, cache types.Iterator, ascending bool, readsetHandler ReadsetHandler) *mvsMergeIterator
- func NewMultiVersionItem() *multiVersionItem
- func NewTrackedIterator(iter types.Iterator, iterationTracker *iterationTracker) *trackedIterator
- func NewValueItem(index int, incarnation int, value []byte) *valueItem
- type IterateSetHandler
- type Iterateset
- type MultiVersionStore
- type MultiVersionValue
- type MultiVersionValueItem
- type NoOpHandler
- type ReadSet
- type ReadsetHandler
- type Store
- func (s *Store) ClearIterateset(index int)
- func (s *Store) ClearReadset(index int)
- func (s *Store) CollectIteratorItems(index int) *db.MemDB
- func (s *Store) GetAllWritesetKeys() map[int][]string
- func (s *Store) GetIterateset(index int) Iterateset
- func (s *Store) GetLatest(key []byte) (value MultiVersionValueItem)
- func (s *Store) GetLatestBeforeIndex(index int, key []byte) (value MultiVersionValueItem)
- func (s *Store) GetReadset(index int) ReadSet
- func (s *Store) Has(index int, key []byte) bool
- func (s *Store) InvalidateWriteset(index int, incarnation int)
- func (s *Store) SetEstimatedWriteset(index int, incarnation int, writeset WriteSet)
- func (s *Store) SetIterateset(index int, iterateset Iterateset)
- func (s *Store) SetReadset(index int, readset ReadSet)
- func (s *Store) SetWriteset(index int, incarnation int, writeset WriteSet)
- func (s *Store) ValidateTransactionState(index int) (bool, []int)
- func (s *Store) VersionedIndexedStore(index int, incarnation int, abortChannel chan occ.Abort) *VersionIndexedStore
- func (s *Store) WriteLatestToStore()
- type VersionIndexedStore
- func (*VersionIndexedStore) CacheWrap(storeKey types.StoreKey) types.CacheWrap
- func (*VersionIndexedStore) CacheWrapWithListeners(storeKey types.StoreKey, listeners []types.WriteListener) types.CacheWrap
- func (*VersionIndexedStore) CacheWrapWithTrace(storeKey types.StoreKey, w io.Writer, tc types.TraceContext) types.CacheWrap
- func (store *VersionIndexedStore) Delete(key []byte)
- func (v *VersionIndexedStore) DeleteAll(start, end []byte) error
- func (store *VersionIndexedStore) Get(key []byte) []byte
- func (v *VersionIndexedStore) GetAllKeyStrsInRange(start, end []byte) (res []string)
- func (store *VersionIndexedStore) GetEvents() []abci.Event
- func (store *VersionIndexedStore) GetReadset() map[string][][]byte
- func (v *VersionIndexedStore) GetStoreType() types.StoreType
- func (v *VersionIndexedStore) GetWorkingHash() ([]byte, error)
- func (store *VersionIndexedStore) GetWriteset() map[string][]byte
- func (store *VersionIndexedStore) Has(key []byte) bool
- func (v *VersionIndexedStore) Iterator(start []byte, end []byte) dbm.Iterator
- func (store *VersionIndexedStore) ResetEvents()
- func (v *VersionIndexedStore) ReverseIterator(start []byte, end []byte) dbm.Iterator
- func (store *VersionIndexedStore) Set(key []byte, value []byte)
- func (store *VersionIndexedStore) UpdateIterateSet(iterationTracker *iterationTracker)
- func (store *VersionIndexedStore) UpdateReadSet(key []byte, value []byte)
- func (store *VersionIndexedStore) ValidateReadset() bool
- func (v *VersionIndexedStore) VersionExists(version int64) bool
- func (store *VersionIndexedStore) Write()
- func (store *VersionIndexedStore) WriteAbort(abort scheduler.Abort)
- func (store *VersionIndexedStore) WriteEstimatesToMultiVersionStore()
- func (store *VersionIndexedStore) WriteToMultiVersionStore()
- type WriteSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDeletedItem ¶
func NewEstimateItem ¶
func NewIterationTracker ¶
func NewMVSMergeIterator ¶
func NewMVSMergeIterator( parent, cache types.Iterator, ascending bool, readsetHandler ReadsetHandler, ) *mvsMergeIterator
func NewMultiVersionItem ¶
func NewMultiVersionItem() *multiVersionItem
func NewTrackedIterator ¶
func NewValueItem ¶
Types ¶
type IterateSetHandler ¶
type IterateSetHandler interface {
UpdateIterateSet(*iterationTracker)
}
exposes a handler for adding items to iterateset, to be called upon iterator close
type Iterateset ¶
type Iterateset []*iterationTracker
type MultiVersionStore ¶
type MultiVersionStore interface {
GetLatest(key []byte) (value MultiVersionValueItem)
GetLatestBeforeIndex(index int, key []byte) (value MultiVersionValueItem)
Has(index int, key []byte) bool
WriteLatestToStore()
SetWriteset(index int, incarnation int, writeset WriteSet)
InvalidateWriteset(index int, incarnation int)
SetEstimatedWriteset(index int, incarnation int, writeset WriteSet)
GetAllWritesetKeys() map[int][]string
CollectIteratorItems(index int) *db.MemDB
SetReadset(index int, readset ReadSet)
GetReadset(index int) ReadSet
ClearReadset(index int)
VersionedIndexedStore(index int, incarnation int, abortChannel chan occ.Abort) *VersionIndexedStore
SetIterateset(index int, iterateset Iterateset)
GetIterateset(index int) Iterateset
ClearIterateset(index int)
ValidateTransactionState(index int) (bool, []int)
}
type MultiVersionValue ¶
type MultiVersionValue interface {
GetLatest() (value MultiVersionValueItem, found bool)
GetLatestNonEstimate() (value MultiVersionValueItem, found bool)
GetLatestBeforeIndex(index int) (value MultiVersionValueItem, found bool)
Set(index int, incarnation int, value []byte)
SetEstimate(index int, incarnation int)
Delete(index int, incarnation int)
Remove(index int)
}
type MultiVersionValueItem ¶
type NoOpHandler ¶
type NoOpHandler struct{}
func (NoOpHandler) UpdateReadSet ¶
func (NoOpHandler) UpdateReadSet(key []byte, value []byte)
type ReadsetHandler ¶
exposes a handler for adding items to readset, useful for iterators
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewMultiVersionStore ¶
func (*Store) ClearIterateset ¶
func (*Store) ClearReadset ¶
func (*Store) CollectIteratorItems ¶
CollectIteratorItems implements MultiVersionStore. It will return a memDB containing all of the keys present in the multiversion store within the iteration range prior to (exclusive of) the index.
func (*Store) GetAllWritesetKeys ¶
GetAllWritesetKeys implements MultiVersionStore.
func (*Store) GetIterateset ¶
func (s *Store) GetIterateset(index int) Iterateset
func (*Store) GetLatest ¶
func (s *Store) GetLatest(key []byte) (value MultiVersionValueItem)
GetLatest implements MultiVersionStore.
func (*Store) GetLatestBeforeIndex ¶
func (s *Store) GetLatestBeforeIndex(index int, key []byte) (value MultiVersionValueItem)
GetLatestBeforeIndex implements MultiVersionStore.
func (*Store) GetReadset ¶
func (*Store) Has ¶
Has implements MultiVersionStore. It checks if the key exists in the multiversion store at or before the specified index.
func (*Store) InvalidateWriteset ¶
InvalidateWriteset iterates over the keys for the given index and incarnation writeset and replaces with ESTIMATEs
func (*Store) SetEstimatedWriteset ¶
SetEstimatedWriteset is used to directly write estimates instead of writing a writeset and later invalidating
func (*Store) SetIterateset ¶
func (s *Store) SetIterateset(index int, iterateset Iterateset)
func (*Store) SetReadset ¶
func (*Store) SetWriteset ¶
SetWriteset sets a writeset for a transaction index, and also writes all of the multiversion items in the writeset to the multiversion store. TODO: returns a list of NEW keys added
func (*Store) ValidateTransactionState ¶
TODO: do we want to return bool + []int where bool indicates whether it was valid and then []int indicates only ones for which we need to wait due to estimates? - yes i think so?
func (*Store) VersionedIndexedStore ¶
func (s *Store) VersionedIndexedStore(index int, incarnation int, abortChannel chan occ.Abort) *VersionIndexedStore
VersionedIndexedStore creates a new versioned index store for a given incarnation and transaction index
func (*Store) WriteLatestToStore ¶
func (s *Store) WriteLatestToStore()
type VersionIndexedStore ¶
type VersionIndexedStore struct {
// contains filtered or unexported fields
}
Version Indexed Store wraps the multiversion store in a way that implements the KVStore interface, but also stores the index of the transaction, and so store actions are applied to the multiversion store using that index
func NewVersionIndexedStore ¶
func NewVersionIndexedStore(parent types.KVStore, multiVersionStore MultiVersionStore, transactionIndex, incarnation int, abortChannel chan scheduler.Abort) *VersionIndexedStore
func (*VersionIndexedStore) CacheWrap ¶
func (*VersionIndexedStore) CacheWrap(storeKey types.StoreKey) types.CacheWrap
CacheWrap implements types.KVStore.
func (*VersionIndexedStore) CacheWrapWithListeners ¶
func (*VersionIndexedStore) CacheWrapWithListeners(storeKey types.StoreKey, listeners []types.WriteListener) types.CacheWrap
CacheWrapWithListeners implements types.KVStore.
func (*VersionIndexedStore) CacheWrapWithTrace ¶
func (*VersionIndexedStore) CacheWrapWithTrace(storeKey types.StoreKey, w io.Writer, tc types.TraceContext) types.CacheWrap
CacheWrapWithTrace implements types.KVStore.
func (*VersionIndexedStore) Delete ¶
func (store *VersionIndexedStore) Delete(key []byte)
Delete implements types.KVStore.
func (*VersionIndexedStore) DeleteAll ¶
func (v *VersionIndexedStore) DeleteAll(start, end []byte) error
func (*VersionIndexedStore) Get ¶
func (store *VersionIndexedStore) Get(key []byte) []byte
Get implements types.KVStore.
func (*VersionIndexedStore) GetAllKeyStrsInRange ¶
func (v *VersionIndexedStore) GetAllKeyStrsInRange(start, end []byte) (res []string)
func (*VersionIndexedStore) GetEvents ¶
func (store *VersionIndexedStore) GetEvents() []abci.Event
GetEvents implements types.CacheWrap so this store can exist on the cache multi store
func (*VersionIndexedStore) GetReadset ¶
func (store *VersionIndexedStore) GetReadset() map[string][][]byte
GetReadset returns the readset
func (*VersionIndexedStore) GetStoreType ¶
func (v *VersionIndexedStore) GetStoreType() types.StoreType
GetStoreType implements types.KVStore.
func (*VersionIndexedStore) GetWorkingHash ¶
func (v *VersionIndexedStore) GetWorkingHash() ([]byte, error)
GetWorkingHash implements types.KVStore.
func (*VersionIndexedStore) GetWriteset ¶
func (store *VersionIndexedStore) GetWriteset() map[string][]byte
GetWriteset returns the writeset
func (*VersionIndexedStore) Has ¶
func (store *VersionIndexedStore) Has(key []byte) bool
Has implements types.KVStore.
func (*VersionIndexedStore) Iterator ¶
func (v *VersionIndexedStore) Iterator(start []byte, end []byte) dbm.Iterator
Iterator implements types.KVStore.
func (*VersionIndexedStore) ResetEvents ¶
func (store *VersionIndexedStore) ResetEvents()
ResetEvents implements types.CacheWrap so this store can exist on the cache multi store
func (*VersionIndexedStore) ReverseIterator ¶
func (v *VersionIndexedStore) ReverseIterator(start []byte, end []byte) dbm.Iterator
ReverseIterator implements types.KVStore.
func (*VersionIndexedStore) Set ¶
func (store *VersionIndexedStore) Set(key []byte, value []byte)
Set implements types.KVStore.
func (*VersionIndexedStore) UpdateIterateSet ¶
func (store *VersionIndexedStore) UpdateIterateSet(iterationTracker *iterationTracker)
func (*VersionIndexedStore) UpdateReadSet ¶
func (store *VersionIndexedStore) UpdateReadSet(key []byte, value []byte)
func (*VersionIndexedStore) ValidateReadset ¶
func (store *VersionIndexedStore) ValidateReadset() bool
This function iterates over the readset, validating that the values in the readset are consistent with the values in the multiversion store and underlying parent store, and returns a boolean indicating validity
func (*VersionIndexedStore) VersionExists ¶
func (v *VersionIndexedStore) VersionExists(version int64) bool
func (*VersionIndexedStore) Write ¶
func (store *VersionIndexedStore) Write()
Write implements types.CacheWrap so this store can exist on the cache multi store
func (*VersionIndexedStore) WriteAbort ¶
func (store *VersionIndexedStore) WriteAbort(abort scheduler.Abort)
WriteAbort writes an abort to the store but only allows one abort to be written PER instance of mvkv. This is because we pair abort channel writes with panics, and if we hit this more than once, it means that the panic was swallowed, so we won't write any aborts after a first abort is written to prevent any potential for deadlocking due to full channels
func (*VersionIndexedStore) WriteEstimatesToMultiVersionStore ¶
func (store *VersionIndexedStore) WriteEstimatesToMultiVersionStore()
func (*VersionIndexedStore) WriteToMultiVersionStore ¶
func (store *VersionIndexedStore) WriteToMultiVersionStore()