Documentation ¶
Overview ¶
Package kvmvccmavl kvmvcc+mavl接口
Index ¶
- Variables
- func DelMavl(db dbm.DB)
- func DisableLog()
- func EnablePrune(enable bool)
- func New(cfg *types.Store, sub []byte) queue.Module
- func SetLogLevel(level string)
- func SetPruneHeight(height int)
- type KVMVCCStore
- func (mvccs *KVMVCCStore) Close()
- func (mvccs *KVMVCCStore) Commit(req *types.ReqHash) ([]byte, error)
- func (mvccs *KVMVCCStore) CommitUpgrade(req *types.ReqHash) ([]byte, error)
- func (mvccs *KVMVCCStore) Del(req *types.StoreDel) ([]byte, error)
- func (mvccs *KVMVCCStore) Get(datas *types.StoreGet) [][]byte
- func (mvccs *KVMVCCStore) GetMaxVersion() (int64, error)
- func (mvccs *KVMVCCStore) IterateRangeByStateHash(statehash []byte, start []byte, end []byte, ascending bool, ...)
- func (mvccs *KVMVCCStore) MemSet(datas *types.StoreSet, hash []byte, sync bool) ([]byte, error)
- func (mvccs *KVMVCCStore) ProcEvent(msg queue.Message)
- func (mvccs *KVMVCCStore) Rollback(req *types.ReqHash) ([]byte, error)
- func (mvccs *KVMVCCStore) Set(datas *types.StoreSet, hash []byte, sync bool) ([]byte, error)
- type KVmMavlStore
- func (kvmMavls *KVmMavlStore) Close()
- func (kvmMavls *KVmMavlStore) Commit(req *types.ReqHash) ([]byte, error)
- func (kvmMavls *KVmMavlStore) CommitUpgrade(req *types.ReqHash) ([]byte, error)
- func (kvmMavls *KVmMavlStore) Del(req *types.StoreDel) ([]byte, error)
- func (kvmMavls *KVmMavlStore) Get(datas *types.StoreGet) [][]byte
- func (kvmMavls *KVmMavlStore) IterateRangeByStateHash(statehash []byte, start []byte, end []byte, ascending bool, ...)
- func (kvmMavls *KVmMavlStore) MemSet(datas *types.StoreSet, sync bool) ([]byte, error)
- func (kvmMavls *KVmMavlStore) MemSetUpgrade(datas *types.StoreSet, sync bool) ([]byte, error)
- func (kvmMavls *KVmMavlStore) ProcEvent(msg *queue.Message)
- func (kvmMavls *KVmMavlStore) Rollback(req *types.ReqHash) ([]byte, error)
- func (kvmMavls *KVmMavlStore) Set(datas *types.StoreSet, sync bool) ([]byte, error)
- type MavlStore
- func (mavls *MavlStore) Close()
- func (mavls *MavlStore) Commit(req *types.ReqHash) ([]byte, error)
- func (mavls *MavlStore) Del(req *types.StoreDel) ([]byte, error)
- func (mavls *MavlStore) Get(datas *types.StoreGet) [][]byte
- func (mavls *MavlStore) IterateRangeByStateHash(statehash []byte, start []byte, end []byte, ascending bool, ...)
- func (mavls *MavlStore) MemSet(datas *types.StoreSet, sync bool) ([]byte, error)
- func (mavls *MavlStore) MemSetUpgrade(datas *types.StoreSet, sync bool) ([]byte, error)
- func (mavls *MavlStore) ProcEvent(msg queue.Message)
- func (mavls *MavlStore) Rollback(req *types.ReqHash) ([]byte, error)
- func (mavls *MavlStore) Set(datas *types.StoreSet, sync bool) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrStateHashLost ... ErrStateHashLost = errors.New("ErrStateHashLost") )
Functions ¶
Types ¶
type KVMVCCStore ¶
type KVMVCCStore struct {
// contains filtered or unexported fields
}
KVMVCCStore provide kvmvcc store interface implementation
func NewKVMVCC ¶
func NewKVMVCC(sub *subKVMVCCConfig, db dbm.DB) *KVMVCCStore
NewKVMVCC construct KVMVCCStore module
func (*KVMVCCStore) Commit ¶
func (mvccs *KVMVCCStore) Commit(req *types.ReqHash) ([]byte, error)
Commit kvs in the mem of KVMVCCStore module to state db and return the StateHash
func (*KVMVCCStore) CommitUpgrade ¶
func (mvccs *KVMVCCStore) CommitUpgrade(req *types.ReqHash) ([]byte, error)
CommitUpgrade kvs in the mem of KVMVCCStore module to state db and re
func (*KVMVCCStore) Del ¶
func (mvccs *KVMVCCStore) Del(req *types.StoreDel) ([]byte, error)
Del set kvs to nil with StateHash
func (*KVMVCCStore) Get ¶
func (mvccs *KVMVCCStore) Get(datas *types.StoreGet) [][]byte
Get kvs with statehash from KVMVCCStore
func (*KVMVCCStore) GetMaxVersion ¶
func (mvccs *KVMVCCStore) GetMaxVersion() (int64, error)
GetMaxVersion 获取当前最大高度
func (*KVMVCCStore) IterateRangeByStateHash ¶
func (mvccs *KVMVCCStore) IterateRangeByStateHash(statehash []byte, start []byte, end []byte, ascending bool, fn func(key, value []byte) bool)
IterateRangeByStateHash travel with Prefix by StateHash to get the latest version kvs.
func (*KVMVCCStore) MemSet ¶
MemSet set kvs to the mem of KVMVCCStore module and return the StateHash
func (*KVMVCCStore) ProcEvent ¶
func (mvccs *KVMVCCStore) ProcEvent(msg queue.Message)
ProcEvent handles supported events
type KVmMavlStore ¶
type KVmMavlStore struct { *drivers.BaseStore *KVMVCCStore *MavlStore // contains filtered or unexported fields }
KVmMavlStore provide kvmvcc and mavl store interface implementation
func (*KVmMavlStore) Commit ¶
func (kvmMavls *KVmMavlStore) Commit(req *types.ReqHash) ([]byte, error)
Commit kvs in the mem of KVmMavlStore module to state db and return the StateHash
func (*KVmMavlStore) CommitUpgrade ¶
func (kvmMavls *KVmMavlStore) CommitUpgrade(req *types.ReqHash) ([]byte, error)
CommitUpgrade kvs in the mem of KVmMavlStore module to state db and return the StateHash
func (*KVmMavlStore) Del ¶
func (kvmMavls *KVmMavlStore) Del(req *types.StoreDel) ([]byte, error)
Del set kvs to nil with StateHash
func (*KVmMavlStore) Get ¶
func (kvmMavls *KVmMavlStore) Get(datas *types.StoreGet) [][]byte
Get kvs with statehash from KVmMavlStore
func (*KVmMavlStore) IterateRangeByStateHash ¶
func (kvmMavls *KVmMavlStore) IterateRangeByStateHash(statehash []byte, start []byte, end []byte, ascending bool, fn func(key, value []byte) bool)
IterateRangeByStateHash travel with Prefix by StateHash to get the latest version kvs.
func (*KVmMavlStore) MemSet ¶
MemSet set kvs to the mem of KVmMavlStore module and return the StateHash
func (*KVmMavlStore) MemSetUpgrade ¶
MemSetUpgrade set kvs to the mem of KVmMavlStore module not cache the tree and return the StateHash
func (*KVmMavlStore) ProcEvent ¶
func (kvmMavls *KVmMavlStore) ProcEvent(msg *queue.Message)
ProcEvent handles supported events
type MavlStore ¶
type MavlStore struct {
// contains filtered or unexported fields
}
MavlStore mavl store struct
func (*MavlStore) IterateRangeByStateHash ¶
func (mavls *MavlStore) IterateRangeByStateHash(statehash []byte, start []byte, end []byte, ascending bool, fn func(key, value []byte) bool)
IterateRangeByStateHash 迭代实现功能; statehash:当前状态hash, start:开始查找的key, end: 结束的key, ascending:升序,降序, fn 迭代回调函数
func (*MavlStore) MemSetUpgrade ¶
MemSetUpgrade 计算hash之后不在内存中存储树