Documentation ¶
Index ¶
- Constants
- Variables
- func CompareMemDB(this unsafe.Pointer, that unsafe.Pointer) int
- func CompareSnapshot(this, that unsafe.Pointer) int
- func Debug(flag bool)
- func ItemSize(p unsafe.Pointer) int
- func MemoryInUse() (sz int64)
- func SnapshotSize(p unsafe.Pointer) int
- type CheckPointCallback
- type Config
- type FileReader
- type FileType
- type FileWriter
- type Item
- type ItemCallback
- type ItemEntry
- type Iterator
- func (it *Iterator) Close()
- func (it *Iterator) Get() []byte
- func (it *Iterator) GetNode() *skiplist.Node
- func (it *Iterator) Next()
- func (it *Iterator) Refresh()
- func (it *Iterator) Seek(bs []byte)
- func (it *Iterator) SeekFirst()
- func (it *Iterator) SetRefreshRate(rate int)
- func (it *Iterator) Valid() bool
- type KeyCompare
- type MemDB
- func (m *MemDB) Close()
- func (m *MemDB) DecodeItem(ver int, buf []byte, r io.Reader) (*Item, error)
- func (m *MemDB) DumpStats() string
- func (m *MemDB) EncodeItem(itm *Item, buf []byte, w io.Writer) error
- func (m *MemDB) GC()
- func (m *MemDB) GetSnapshots() []*Snapshot
- func (m *MemDB) ItemsCount() int64
- func (m *MemDB) LoadFromDisk(dir string, concurr int, callb ItemCallback) (*Snapshot, error)
- func (m *MemDB) MemoryInUse() int64
- func (m *MemDB) NewIterator(snap *Snapshot) *Iterator
- func (m *MemDB) NewSnapshot() (*Snapshot, error)
- func (m *MemDB) NewWriter() *Writer
- func (m *MemDB) StoreToDisk(dir string, snap *Snapshot, concurr int, itmCallback ItemCallback) (err error)
- func (m *MemDB) Visitor(snap *Snapshot, callb VisitorCallback, shards int, concurrency int) error
- type NodeList
- type Snapshot
- type VisitorCallback
- type Writer
- func (w *Writer) Delete(bs []byte) (success bool)
- func (w *Writer) Delete2(bs []byte) (n *skiplist.Node, success bool)
- func (w *Writer) DeleteNode(x *skiplist.Node) (success bool)
- func (w *Writer) GetNode(bs []byte) *skiplist.Node
- func (w *Writer) Put(bs []byte)
- func (w *Writer) Put2(bs []byte) (n *skiplist.Node)
Constants ¶
View Source
const DiskBlockSize = 512 * 1024
Variables ¶
View Source
var ( ErrMaxSnapshotsLimitReached = fmt.Errorf("Maximum snapshots limit reached") ErrShutdown = fmt.Errorf("MemDB instance has been shutdown") )
View Source
var (
ErrNotEnoughSpace = errors.New("Not enough space in the buffer")
)
Functions ¶
func CompareSnapshot ¶
func MemoryInUse ¶
func MemoryInUse() (sz int64)
func SnapshotSize ¶
Types ¶
type CheckPointCallback ¶
type CheckPointCallback func()
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func DefaultConfig ¶
func DefaultConfig() Config
func (*Config) IgnoreItemSize ¶
func (cfg *Config) IgnoreItemSize()
func (*Config) SetFileType ¶
func (*Config) SetKeyComparator ¶
func (cfg *Config) SetKeyComparator(cmp KeyCompare)
func (*Config) UseDeltaInterleaving ¶
func (cfg *Config) UseDeltaInterleaving()
type FileReader ¶
type FileWriter ¶
type ItemCallback ¶
type ItemCallback func(*ItemEntry)
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
func (*Iterator) Refresh ¶
func (it *Iterator) Refresh()
Refresh can help safe-memory-reclaimer to free deleted objects
func (*Iterator) SetRefreshRate ¶
type KeyCompare ¶
type MemDB ¶
type MemDB struct { Config // contains filtered or unexported fields }
func NewWithConfig ¶
func (*MemDB) DecodeItem ¶
func (*MemDB) GetSnapshots ¶
func (*MemDB) ItemsCount ¶
func (*MemDB) LoadFromDisk ¶
func (*MemDB) MemoryInUse ¶
func (*MemDB) NewIterator ¶
func (*MemDB) NewSnapshot ¶
func (*MemDB) StoreToDisk ¶
type NodeList ¶
type NodeList struct {
// contains filtered or unexported fields
}
func NewNodeList ¶
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
func (*Snapshot) NewIterator ¶
type VisitorCallback ¶
Click to show internal directories.
Click to hide internal directories.