Documentation ¶
Index ¶
- type StoreCacheMgr
- func (mgr *StoreCacheMgr) AddBlock(blockHeight uint64, updateBatch protocol.StoreBatcher)
- func (mgr *StoreCacheMgr) Clear()
- func (mgr *StoreCacheMgr) DelBlock(blockHeight uint64)
- func (mgr *StoreCacheMgr) Get(key string) ([]byte, bool)
- func (mgr *StoreCacheMgr) GetPendingBlockSize() int
- func (mgr *StoreCacheMgr) Has(key string) (bool, bool)
- func (mgr *StoreCacheMgr) LockForFlush()
- func (mgr *StoreCacheMgr) UnLockFlush()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StoreCacheMgr ¶
StoreCacheMgr provide handle to cache instances
func NewStoreCacheMgr ¶
func NewStoreCacheMgr(chainId string, blockWriteBufferSize int, logger protocol.Logger) *StoreCacheMgr
NewStoreCacheMgr construct a new `StoreCacheMgr` with given chainId
func (*StoreCacheMgr) AddBlock ¶
func (mgr *StoreCacheMgr) AddBlock(blockHeight uint64, updateBatch protocol.StoreBatcher)
AddBlock cache a block with given block height and update batch
func (*StoreCacheMgr) Clear ¶
func (mgr *StoreCacheMgr) Clear()
func (*StoreCacheMgr) DelBlock ¶
func (mgr *StoreCacheMgr) DelBlock(blockHeight uint64)
DelBlock delete block for the given block height
func (*StoreCacheMgr) Get ¶
func (mgr *StoreCacheMgr) Get(key string) ([]byte, bool)
Get returns value if the key in cache, or returns nil if none exists.
func (*StoreCacheMgr) GetPendingBlockSize ¶
func (mgr *StoreCacheMgr) GetPendingBlockSize() int
func (*StoreCacheMgr) Has ¶
func (mgr *StoreCacheMgr) Has(key string) (bool, bool)
Has returns true if the key in cache, or returns false if none exists.
func (*StoreCacheMgr) LockForFlush ¶
func (mgr *StoreCacheMgr) LockForFlush()
LockForFlush used to lock cache until all cache item be flushed to db
func (*StoreCacheMgr) UnLockFlush ¶
func (mgr *StoreCacheMgr) UnLockFlush()
UnLockFlush used to unlock cache by release all semaphore
Click to show internal directories.
Click to hide internal directories.