Documentation ¶
Index ¶
- Constants
- Variables
- type BackwardIter
- type CacheStore
- func (cs *CacheStore) Close()
- func (cs *CacheStore) Delete(key []byte)
- func (cs *CacheStore) Get(key []byte) (res []byte, status types.CacheStatus)
- func (cs *CacheStore) GetObj(key []byte, ptr *types.Serializable) (status types.CacheStatus)
- func (cs *CacheStore) GetObjCopy(key []byte, ptr *types.Serializable) (status types.CacheStatus)
- func (cs *CacheStore) GetReadOnlyObj(key []byte, ptr *types.Serializable) (status types.CacheStatus)
- func (cs *CacheStore) Iterator(start, end []byte) types.ObjIterator
- func (cs *CacheStore) RealDelete(key []byte)
- func (cs *CacheStore) ReverseIterator(start, end []byte) types.ObjIterator
- func (cs *CacheStore) ScanAllEntries(fn func(key []byte, obj interface{}, isDeleted bool))
- func (cs *CacheStore) Set(key, value []byte)
- func (cs *CacheStore) SetObj(key []byte, obj types.Serializable)
- func (cs *CacheStore) Size() int
- type ForwardIter
- type MockRootStore
- func (rs *MockRootStore) ActiveCount() int
- func (rs *MockRootStore) BeginWrite()
- func (rs *MockRootStore) CheckConsistency()
- func (rs *MockRootStore) Close()
- func (rs *MockRootStore) Delete(key []byte)
- func (rs *MockRootStore) EndWrite()
- func (rs *MockRootStore) Get(key []byte) []byte
- func (rs *MockRootStore) GetObjCopy(key []byte, ptr *types.Serializable)
- func (rs *MockRootStore) GetReadOnlyObj(key []byte, ptr *types.Serializable)
- func (rs *MockRootStore) GetTrunkStore() interface{}
- func (rs *MockRootStore) Has(key []byte) bool
- func (rs *MockRootStore) Iterator(start, end []byte) types.ObjIterator
- func (rs *MockRootStore) PrepareForDeletion(key []byte)
- func (rs *MockRootStore) PrepareForUpdate(key []byte)
- func (rs *MockRootStore) ReverseIterator(start, end []byte) types.ObjIterator
- func (rs *MockRootStore) Set(key, value []byte)
- func (rs *MockRootStore) SetHeight(h int64)
- func (rs *MockRootStore) SetObj(key []byte, obj types.Serializable)
- type MultiStore
- func (ms *MultiStore) Close(writeBack bool)
- func (ms *MultiStore) Delete(key []byte)
- func (ms *MultiStore) Get(key []byte) []byte
- func (ms *MultiStore) GetObj(key []byte, ptr *types.Serializable)
- func (ms *MultiStore) GetReadOnlyObj(key []byte, ptr *types.Serializable)
- func (ms *MultiStore) Has(key []byte) bool
- func (ms *MultiStore) Iterator(start, end []byte) types.ObjIterator
- func (ms *MultiStore) ReverseIterator(start, end []byte) types.ObjIterator
- func (ms *MultiStore) Set(key, value []byte)
- func (ms *MultiStore) SetObj(key []byte, obj types.Serializable)
- func (ms *MultiStore) SubStore(storeKey types.StoreKey) types.KObjStore
- type PrefixedStore
- func (s PrefixedStore) Delete(key []byte)
- func (s PrefixedStore) Get(key []byte) []byte
- func (s PrefixedStore) GetObj(key []byte, ptr *types.Serializable)
- func (s PrefixedStore) GetReadOnlyObj(key []byte, ptr *types.Serializable)
- func (s PrefixedStore) Has(key []byte) bool
- func (s PrefixedStore) Iterator(start, end []byte) types.ObjIterator
- func (s PrefixedStore) ReverseIterator(start, end []byte) types.ObjIterator
- func (s PrefixedStore) Set(key, value []byte)
- func (s PrefixedStore) SetObj(key []byte, obj types.Serializable)
- type RootStore
- func (root *RootStore) ActiveCount() int
- func (root *RootStore) BeginWrite()
- func (root *RootStore) CheckConsistency()
- func (root *RootStore) Close()
- func (root *RootStore) Delete(key []byte)
- func (root *RootStore) EndWrite()
- func (root *RootStore) Get(key []byte) []byte
- func (root *RootStore) GetObjCopy(key []byte, ptr *types.Serializable)
- func (root *RootStore) GetReadOnlyObj(key []byte, ptr *types.Serializable)
- func (root *RootStore) GetRootHash() []byte
- func (root *RootStore) GetTrunkStore() interface{}
- func (root *RootStore) Has(key []byte) bool
- func (root *RootStore) Iterator(start, end []byte) types.ObjIterator
- func (root *RootStore) PrepareForDeletion(key []byte)
- func (root *RootStore) PrepareForUpdate(key []byte)
- func (root *RootStore) ReverseIterator(start, end []byte) types.ObjIterator
- func (root *RootStore) Set(key, value []byte)
- func (root *RootStore) SetHeight(h int64)
- func (root *RootStore) SetObj(key []byte, obj types.Serializable)
- type RootStoreIterator
- func (iter *RootStoreIterator) Close()
- func (iter *RootStoreIterator) Domain() (start []byte, end []byte)
- func (iter *RootStoreIterator) Key() (key []byte)
- func (iter *RootStoreIterator) Next()
- func (iter *RootStoreIterator) ObjValue(ptr *types.Serializable)
- func (iter *RootStoreIterator) Valid() bool
- func (iter *RootStoreIterator) Value() (value []byte)
- type TrunkStore
- func (ts *TrunkStore) ActiveCount() int
- func (ts *TrunkStore) Cached() *MultiStore
- func (ts *TrunkStore) Close(writeBack bool)
- func (ts *TrunkStore) Get(key []byte) []byte
- func (ts *TrunkStore) GetObjCopy(key []byte, ptr *types.Serializable)
- func (ts *TrunkStore) GetReadOnlyObj(key []byte, ptr *types.Serializable)
- func (ts *TrunkStore) Has(key []byte) bool
- func (ts *TrunkStore) Iterator(start, end []byte) types.ObjIterator
- func (ts *TrunkStore) PrepareForDeletion(key []byte)
- func (ts *TrunkStore) PrepareForUpdate(key []byte)
- func (ts *TrunkStore) ReverseIterator(start, end []byte) types.ObjIterator
- func (ts *TrunkStore) Update(updator func(cache *CacheStore))
Constants ¶
View Source
const CacheSizeLimit = 1024 * 1024
Variables ¶
View Source
var PhaseTrunkTime, PhaseEndWriteTime uint64
Functions ¶
This section is empty.
Types ¶
type BackwardIter ¶
type BackwardIter struct {
// contains filtered or unexported fields
}
func (*BackwardIter) Close ¶
func (iter *BackwardIter) Close()
func (*BackwardIter) Domain ¶
func (iter *BackwardIter) Domain() ([]byte, []byte)
func (*BackwardIter) Key ¶
func (iter *BackwardIter) Key() []byte
func (*BackwardIter) Next ¶
func (iter *BackwardIter) Next()
func (*BackwardIter) ObjValue ¶
func (iter *BackwardIter) ObjValue(ptr *types.Serializable)
func (*BackwardIter) Valid ¶
func (iter *BackwardIter) Valid() bool
func (*BackwardIter) Value ¶
func (iter *BackwardIter) Value() []byte
type CacheStore ¶
type CacheStore struct {
// contains filtered or unexported fields
}
func NewCacheStore ¶
func NewCacheStore() *CacheStore
func (*CacheStore) Close ¶
func (cs *CacheStore) Close()
func (*CacheStore) Delete ¶
func (cs *CacheStore) Delete(key []byte)
func (*CacheStore) Get ¶
func (cs *CacheStore) Get(key []byte) (res []byte, status types.CacheStatus)
func (*CacheStore) GetObj ¶
func (cs *CacheStore) GetObj(key []byte, ptr *types.Serializable) (status types.CacheStatus)
Move the object out from this cache, and left a Nil value in cache This object must be returned to cache using SetObj
func (*CacheStore) GetObjCopy ¶
func (cs *CacheStore) GetObjCopy(key []byte, ptr *types.Serializable) (status types.CacheStatus)
Get the object's copy
func (*CacheStore) GetReadOnlyObj ¶
func (cs *CacheStore) GetReadOnlyObj(key []byte, ptr *types.Serializable) (status types.CacheStatus)
Get the object and this object is still contained in cache, so the client must use the object as readonly
func (*CacheStore) Iterator ¶
func (cs *CacheStore) Iterator(start, end []byte) types.ObjIterator
func (*CacheStore) RealDelete ¶
func (cs *CacheStore) RealDelete(key []byte)
func (*CacheStore) ReverseIterator ¶
func (cs *CacheStore) ReverseIterator(start, end []byte) types.ObjIterator
func (*CacheStore) ScanAllEntries ¶
func (cs *CacheStore) ScanAllEntries(fn func(key []byte, obj interface{}, isDeleted bool))
func (*CacheStore) Set ¶
func (cs *CacheStore) Set(key, value []byte)
func (*CacheStore) SetObj ¶
func (cs *CacheStore) SetObj(key []byte, obj types.Serializable)
func (*CacheStore) Size ¶
func (cs *CacheStore) Size() int
type ForwardIter ¶
type ForwardIter struct {
// contains filtered or unexported fields
}
func (*ForwardIter) Close ¶
func (iter *ForwardIter) Close()
func (*ForwardIter) Domain ¶
func (iter *ForwardIter) Domain() ([]byte, []byte)
func (*ForwardIter) Key ¶
func (iter *ForwardIter) Key() []byte
func (*ForwardIter) Next ¶
func (iter *ForwardIter) Next()
func (*ForwardIter) ObjValue ¶
func (iter *ForwardIter) ObjValue(ptr *types.Serializable)
func (*ForwardIter) Valid ¶
func (iter *ForwardIter) Valid() bool
func (*ForwardIter) Value ¶
func (iter *ForwardIter) Value() []byte
type MockRootStore ¶
type MockRootStore struct {
// contains filtered or unexported fields
}
func NewMockRootStore ¶
func NewMockRootStore() *MockRootStore
func (*MockRootStore) ActiveCount ¶
func (rs *MockRootStore) ActiveCount() int
func (*MockRootStore) BeginWrite ¶
func (rs *MockRootStore) BeginWrite()
func (*MockRootStore) CheckConsistency ¶
func (rs *MockRootStore) CheckConsistency()
func (*MockRootStore) Close ¶
func (rs *MockRootStore) Close()
func (*MockRootStore) Delete ¶
func (rs *MockRootStore) Delete(key []byte)
func (*MockRootStore) EndWrite ¶
func (rs *MockRootStore) EndWrite()
func (*MockRootStore) Get ¶
func (rs *MockRootStore) Get(key []byte) []byte
func (*MockRootStore) GetObjCopy ¶
func (rs *MockRootStore) GetObjCopy(key []byte, ptr *types.Serializable)
func (*MockRootStore) GetReadOnlyObj ¶
func (rs *MockRootStore) GetReadOnlyObj(key []byte, ptr *types.Serializable)
func (*MockRootStore) GetTrunkStore ¶
func (rs *MockRootStore) GetTrunkStore() interface{}
func (*MockRootStore) Has ¶
func (rs *MockRootStore) Has(key []byte) bool
func (*MockRootStore) Iterator ¶
func (rs *MockRootStore) Iterator(start, end []byte) types.ObjIterator
func (*MockRootStore) PrepareForDeletion ¶
func (rs *MockRootStore) PrepareForDeletion(key []byte)
func (*MockRootStore) PrepareForUpdate ¶
func (rs *MockRootStore) PrepareForUpdate(key []byte)
func (*MockRootStore) ReverseIterator ¶
func (rs *MockRootStore) ReverseIterator(start, end []byte) types.ObjIterator
func (*MockRootStore) Set ¶
func (rs *MockRootStore) Set(key, value []byte)
func (*MockRootStore) SetHeight ¶
func (rs *MockRootStore) SetHeight(h int64)
func (*MockRootStore) SetObj ¶
func (rs *MockRootStore) SetObj(key []byte, obj types.Serializable)
type MultiStore ¶
type MultiStore struct {
// contains filtered or unexported fields
}
We use a new TrunkStore for transaction
func (*MultiStore) Close ¶
func (ms *MultiStore) Close(writeBack bool)
func (*MultiStore) Delete ¶
func (ms *MultiStore) Delete(key []byte)
func (*MultiStore) Get ¶
func (ms *MultiStore) Get(key []byte) []byte
func (*MultiStore) GetObj ¶
func (ms *MultiStore) GetObj(key []byte, ptr *types.Serializable)
func (*MultiStore) GetReadOnlyObj ¶
func (ms *MultiStore) GetReadOnlyObj(key []byte, ptr *types.Serializable)
func (*MultiStore) Has ¶
func (ms *MultiStore) Has(key []byte) bool
func (*MultiStore) Iterator ¶
func (ms *MultiStore) Iterator(start, end []byte) types.ObjIterator
func (*MultiStore) ReverseIterator ¶
func (ms *MultiStore) ReverseIterator(start, end []byte) types.ObjIterator
func (*MultiStore) Set ¶
func (ms *MultiStore) Set(key, value []byte)
func (*MultiStore) SetObj ¶
func (ms *MultiStore) SetObj(key []byte, obj types.Serializable)
type PrefixedStore ¶
type PrefixedStore struct {
// contains filtered or unexported fields
}
func NewPrefixedStore ¶
func NewPrefixedStore(parent *MultiStore, prefix []byte) PrefixedStore
func (PrefixedStore) GetObj ¶
func (s PrefixedStore) GetObj(key []byte, ptr *types.Serializable)
Implements KObjStore
func (PrefixedStore) GetReadOnlyObj ¶
func (s PrefixedStore) GetReadOnlyObj(key []byte, ptr *types.Serializable)
Implements KObjStore
func (PrefixedStore) Iterator ¶
func (s PrefixedStore) Iterator(start, end []byte) types.ObjIterator
Implements KObjStore
func (PrefixedStore) ReverseIterator ¶
func (s PrefixedStore) ReverseIterator(start, end []byte) types.ObjIterator
Implements KObjStore
func (PrefixedStore) SetObj ¶
func (s PrefixedStore) SetObj(key []byte, obj types.Serializable)
Implements KObjStore
type RootStore ¶
type RootStore struct {
// contains filtered or unexported fields
}
func NewRootStore ¶
func (*RootStore) ActiveCount ¶
func (*RootStore) BeginWrite ¶
func (root *RootStore) BeginWrite()
func (*RootStore) CheckConsistency ¶
func (root *RootStore) CheckConsistency()
func (*RootStore) GetObjCopy ¶
func (root *RootStore) GetObjCopy(key []byte, ptr *types.Serializable)
func (*RootStore) GetReadOnlyObj ¶
func (root *RootStore) GetReadOnlyObj(key []byte, ptr *types.Serializable)
func (*RootStore) GetRootHash ¶
func (*RootStore) GetTrunkStore ¶
func (root *RootStore) GetTrunkStore() interface{}
func (*RootStore) PrepareForDeletion ¶
func (*RootStore) PrepareForUpdate ¶
func (*RootStore) ReverseIterator ¶
func (root *RootStore) ReverseIterator(start, end []byte) types.ObjIterator
type RootStoreIterator ¶
type RootStoreIterator struct {
// contains filtered or unexported fields
}
func (*RootStoreIterator) Close ¶
func (iter *RootStoreIterator) Close()
func (*RootStoreIterator) Domain ¶
func (iter *RootStoreIterator) Domain() (start []byte, end []byte)
func (*RootStoreIterator) Key ¶
func (iter *RootStoreIterator) Key() (key []byte)
func (*RootStoreIterator) Next ¶
func (iter *RootStoreIterator) Next()
func (*RootStoreIterator) ObjValue ¶
func (iter *RootStoreIterator) ObjValue(ptr *types.Serializable)
func (*RootStoreIterator) Valid ¶
func (iter *RootStoreIterator) Valid() bool
func (*RootStoreIterator) Value ¶
func (iter *RootStoreIterator) Value() (value []byte)
type TrunkStore ¶
type TrunkStore struct {
// contains filtered or unexported fields
}
We use a new TrunkStore for every block
func (*TrunkStore) ActiveCount ¶
func (ts *TrunkStore) ActiveCount() int
func (*TrunkStore) Cached ¶
func (ts *TrunkStore) Cached() *MultiStore
func (*TrunkStore) Close ¶
func (ts *TrunkStore) Close(writeBack bool)
func (*TrunkStore) Get ¶
func (ts *TrunkStore) Get(key []byte) []byte
func (*TrunkStore) GetObjCopy ¶
func (ts *TrunkStore) GetObjCopy(key []byte, ptr *types.Serializable)
func (*TrunkStore) GetReadOnlyObj ¶
func (ts *TrunkStore) GetReadOnlyObj(key []byte, ptr *types.Serializable)
func (*TrunkStore) Has ¶
func (ts *TrunkStore) Has(key []byte) bool
func (*TrunkStore) Iterator ¶
func (ts *TrunkStore) Iterator(start, end []byte) types.ObjIterator
func (*TrunkStore) PrepareForDeletion ¶
func (ts *TrunkStore) PrepareForDeletion(key []byte)
func (*TrunkStore) PrepareForUpdate ¶
func (ts *TrunkStore) PrepareForUpdate(key []byte)
func (*TrunkStore) ReverseIterator ¶
func (ts *TrunkStore) ReverseIterator(start, end []byte) types.ObjIterator
func (*TrunkStore) Update ¶
func (ts *TrunkStore) Update(updator func(cache *CacheStore))
Source Files ¶
Click to show internal directories.
Click to hide internal directories.