Documentation
¶
Index ¶
- Constants
- Variables
- type Cache
- type CacheOp
- type CommitData
- func (*CommitData) Descriptor() ([]byte, []int)
- func (m *CommitData) GetHash() []byte
- func (m *CommitData) GetVersion() int64
- func (*CommitData) ProtoMessage()
- func (m *CommitData) Reset()
- func (m *CommitData) String() string
- func (m *CommitData) XXX_DiscardUnknown()
- func (m *CommitData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CommitData) XXX_Merge(src proto.Message)
- func (m *CommitData) XXX_Size() int
- func (m *CommitData) XXX_Unmarshal(b []byte) error
- type KVCache
- type Snapshot
- type Store
- type TreeReader
- type TreeWriter
Constants ¶
View Source
const (
// StateDbName is the filename of the kvstore
StateDbName = "mstate"
)
Variables ¶
View Source
var ( // ErrValueNotFound returned when the value for a key is nil ErrValueNotFound = errors.New("Store get: nil value for given key") )
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { // Get from the cache or tree Get(key []byte) ([]byte, error) // Does the store contain the given key Has(key []byte) bool // Put to the cache or tree Put(key, value []byte) // Delete a key/value pair Remove(key []byte) // ToBatch returns the cache storage ToBatch() map[string]CacheOp }
Cache is the used to batch writes for commit
type CommitData ¶
type CommitData struct { Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` Version int64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
State commit information
func (*CommitData) Descriptor ¶
func (*CommitData) Descriptor() ([]byte, []int)
func (*CommitData) GetHash ¶
func (m *CommitData) GetHash() []byte
func (*CommitData) GetVersion ¶
func (m *CommitData) GetVersion() int64
func (*CommitData) ProtoMessage ¶
func (*CommitData) ProtoMessage()
func (*CommitData) Reset ¶
func (m *CommitData) Reset()
func (*CommitData) String ¶
func (m *CommitData) String() string
func (*CommitData) XXX_DiscardUnknown ¶
func (m *CommitData) XXX_DiscardUnknown()
func (*CommitData) XXX_Marshal ¶
func (m *CommitData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CommitData) XXX_Merge ¶
func (m *CommitData) XXX_Merge(src proto.Message)
func (*CommitData) XXX_Size ¶
func (m *CommitData) XXX_Size() int
func (*CommitData) XXX_Unmarshal ¶
func (m *CommitData) XXX_Unmarshal(b []byte) error
type KVCache ¶
type KVCache struct {
// contains filtered or unexported fields
}
KVCache provides a cached used for r/w access to storage
func NewCache ¶
func NewCache(snap TreeReader) *KVCache
NewCache return a fresh empty cache with ref to the State Store
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
func NewSnaphot ¶
func NewSnaphot(tree *iavl.MutableTree) Snapshot
type Store ¶
type Store struct { CommitInfo CommitData // contains filtered or unexported fields }
Store provides access the the levelDb and Tree
func NewStore ¶
NewStore creates a new instance. If 'dbdir' == "", it'll return an in-memory database
func (*Store) Commit ¶
func (st *Store) Commit(batch map[string]CacheOp) CommitData
Commit information about the current state to storage
func (*Store) Snapshot ¶
func (st *Store) Snapshot() TreeReader
type TreeReader ¶
type TreeReader interface { // Get from committed state in the tree Get(key []byte) ([]byte, error) // IterateKeyRange over committed state IterateKeyRange(start, end []byte, ascending bool, fn func(key []byte, value []byte) bool) bool }
TreeReader provides read access to committed state
type TreeWriter ¶
type TreeWriter interface { Commit(batch map[string]CacheOp) CommitData Snapshot() TreeReader }
TreeWriter writes to state and provides a snapshot of committed state
Click to show internal directories.
Click to hide internal directories.