Documentation ¶
Index ¶
- type Arena
- type Iterator
- func (s *Iterator) Close() error
- func (s *Iterator) Key() []byte
- func (s *Iterator) Name() string
- func (s *Iterator) Next()
- func (s *Iterator) Prev()
- func (s *Iterator) Seek(target []byte)
- func (s *Iterator) SeekForPrev(target []byte)
- func (s *Iterator) SeekToFirst()
- func (s *Iterator) SeekToLast()
- func (s *Iterator) Valid() bool
- func (s *Iterator) Value() y.ValueStruct
- type Skiplist
- func (s *Skiplist) DecrRef()
- func (s *Skiplist) Empty() bool
- func (s *Skiplist) Get(key []byte) y.ValueStruct
- func (s *Skiplist) Height() int32
- func (s *Skiplist) IncrRef()
- func (s *Skiplist) MemSize() int64
- func (s *Skiplist) NewIterator() *Iterator
- func (s *Skiplist) NewUniIterator(reversed bool) *UniIterator
- func (s *Skiplist) Put(key []byte, v y.ValueStruct)
- func (s *Skiplist) Valid() bool
- type UniIterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Arena ¶
type Arena struct {
// contains filtered or unexported fields
}
Arena should be lock-free.
func (*Arena) GetVal ¶
func (s *Arena) GetVal(offset uint32, size uint16) (ret y.ValueStruct)
GetVal returns byte slice at offset. The given size should be just the value size and should NOT include the meta bytes.
func (*Arena) PutVal ¶
func (s *Arena) PutVal(v y.ValueStruct) uint32
Put will *copy* val into arena. To make better use of this, reuse your input val buffer. Returns an offset into buf. User is responsible for remembering size of val. We could also store this size inside arena but the encoding and decoding will incur some overhead.
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
Iterator is an iterator over skiplist object. For new objects, you just need to initialize Iterator.list.
func (*Iterator) SeekForPrev ¶
SeekForPrev finds an entry with key <= target.
func (*Iterator) SeekToFirst ¶
func (s *Iterator) SeekToFirst()
SeekToFirst seeks position at the first entry in list. Final state of iterator is Valid() iff list is not empty.
func (*Iterator) SeekToLast ¶
func (s *Iterator) SeekToLast()
SeekToLast seeks position at the last entry in list. Final state of iterator is Valid() iff list is not empty.
type Skiplist ¶
type Skiplist struct {
// contains filtered or unexported fields
}
func NewSkiplist ¶
func (*Skiplist) MemSize ¶
MemSize returns the size of the Skiplist in terms of how much memory is used within its internal arena.
func (*Skiplist) NewIterator ¶
func (*Skiplist) NewUniIterator ¶
func (s *Skiplist) NewUniIterator(reversed bool) *UniIterator
type UniIterator ¶
type UniIterator struct {
// contains filtered or unexported fields
}
UniIterator is a unidirectional memtable iterator. It is a thin wrapper around Iterator. We like to keep Iterator as before, because it is more powerful and we might support bidirectional iterators in the future.
func (*UniIterator) Close ¶
func (s *UniIterator) Close() error
func (*UniIterator) Key ¶
func (s *UniIterator) Key() []byte
func (*UniIterator) Name ¶
func (s *UniIterator) Name() string
func (*UniIterator) Next ¶
func (s *UniIterator) Next()
func (*UniIterator) Rewind ¶
func (s *UniIterator) Rewind()
func (*UniIterator) Seek ¶
func (s *UniIterator) Seek(key []byte)
func (*UniIterator) Valid ¶
func (s *UniIterator) Valid() bool
func (*UniIterator) Value ¶
func (s *UniIterator) Value() y.ValueStruct