Documentation ¶
Index ¶
- type Hint
- type Iterator
- func (it *Iterator) Key() []byte
- func (it *Iterator) Next()
- func (it *Iterator) Prev()
- func (it *Iterator) Seek(seekKey []byte)
- func (it *Iterator) SeekForExclusivePrev(target []byte)
- func (it *Iterator) SeekForPrev(target []byte)
- func (it *Iterator) SeekToFirst()
- func (it *Iterator) SeekToLast()
- func (it *Iterator) Valid() bool
- func (it *Iterator) Value() []byte
- type MemStore
- func (ls *MemStore) Delete(key []byte) bool
- func (ls *MemStore) DeleteWithHint(key []byte, hint *Hint) bool
- func (ls *MemStore) DumpToFile(fileName string, meta []byte) error
- func (ls *MemStore) Get(key, buf []byte) []byte
- func (ls *MemStore) Len() int
- func (ls *MemStore) LoadFromFile(fileName string) (meta []byte, err error)
- func (ls *MemStore) NewIterator() *Iterator
- func (ls *MemStore) Put(key []byte, v []byte) bool
- func (ls *MemStore) PutWithHint(key []byte, v []byte, hint *Hint) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
Iterator iterates the entries in the MemStore.
func (*Iterator) SeekForExclusivePrev ¶
SeekForExclusivePrev locates the iterator to the last entry with key < target.
func (*Iterator) SeekForPrev ¶
SeekForPrev locates the iterator to the last entry with key <= target.
func (*Iterator) SeekToFirst ¶
func (it *Iterator) SeekToFirst()
SeekToFirst locates the iterator to the first entry.
func (*Iterator) SeekToLast ¶
func (it *Iterator) SeekToLast()
SeekToLast locates the iterator to the last entry.
type MemStore ¶
type MemStore struct {
// contains filtered or unexported fields
}
MemStore is a skiplist variant used to store lock. Compares to normal skip list, it only supports single thread write. But it can reuse the memory, so that the memory usage doesn't keep growing.
func NewMemStore ¶
NewMemStore returns a new mem store.
func (*MemStore) DeleteWithHint ¶
DeleteWithHint deletes a value with the key and hint.
func (*MemStore) DumpToFile ¶
DumpToFile dumps the meta to a file
func (*MemStore) LoadFromFile ¶
LoadFromFile load a meta from a file.
func (*MemStore) NewIterator ¶
NewIterator returns a new Iterator for the lock store.