Documentation ¶
Index ¶
- Constants
- Variables
- func CompareBS(this, that unsafe.Pointer) int
- func CompareBytes(this, that unsafe.Pointer) int
- func CompareInt(this, that unsafe.Pointer) int
- func NewByteKeyItem(k []byte) unsafe.Pointer
- func NewMergeIterator(iters []*Iterator) *mIterator
- type AccessBarrier
- type ActionBuffer
- type BarrierSession
- type BarrierSessionDestructor
- type Builder
- type CompareFn
- type Config
- type FreeFn
- type ItemSizeFn
- type Iterator
- func (it *Iterator) Close()
- func (it *Iterator) Delete()
- func (it *Iterator) Get() unsafe.Pointer
- func (it *Iterator) GetNode() *Node
- func (it *Iterator) Next()
- func (it *Iterator) Seek(itm unsafe.Pointer) bool
- func (it *Iterator) SeekFirst()
- func (it *Iterator) SeekWithCmp(itm unsafe.Pointer, cmp CompareFn, eqCmp CompareFn) bool
- func (it *Iterator) Valid() bool
- type MallocFn
- type Node
- type NodeCallback
- type NodeRef
- type Segment
- type Skiplist
- func (s *Skiplist) Delete(itm unsafe.Pointer, cmp CompareFn, buf *ActionBuffer, sts *Stats) bool
- func (s *Skiplist) DeleteNode(n *Node, cmp CompareFn, buf *ActionBuffer, sts *Stats) bool
- func (s *Skiplist) FreeBuf(b *ActionBuffer)
- func (s *Skiplist) FreeNode(n *Node, sts *Stats)
- func (s *Skiplist) GetAccesBarrier() *AccessBarrier
- func (s *Skiplist) GetRangeSplitItems(nways int) []unsafe.Pointer
- func (s *Skiplist) GetStats() StatsReport
- func (s *Skiplist) HeadNode() *Node
- func (s *Skiplist) Insert(itm unsafe.Pointer, cmp CompareFn, buf *ActionBuffer, sts *Stats) (success bool)
- func (s *Skiplist) Insert2(itm unsafe.Pointer, inscmp CompareFn, eqCmp CompareFn, buf *ActionBuffer, ...) (*Node, bool)
- func (s *Skiplist) Insert3(itm unsafe.Pointer, insCmp CompareFn, eqCmp CompareFn, buf *ActionBuffer, ...) (*Node, bool)
- func (s *Skiplist) MakeBuf() *ActionBuffer
- func (s *Skiplist) MemoryInUse() int64
- func (s *Skiplist) NewIterator(cmp CompareFn, buf *ActionBuffer) *Iterator
- func (s *Skiplist) NewLevel(randFn func() float32) int
- func (s *Skiplist) Size(n *Node) int
- func (s *Skiplist) TailNode() *Node
- type Stats
- type StatsReport
Constants ¶
View Source
const MaxLevel = 32
Variables ¶
View Source
var Debug bool
Functions ¶
func CompareBytes ¶
func CompareInt ¶
func NewByteKeyItem ¶
func NewMergeIterator ¶
func NewMergeIterator(iters []*Iterator) *mIterator
Types ¶
type AccessBarrier ¶
func (*AccessBarrier) Acquire ¶
func (ab *AccessBarrier) Acquire() *BarrierSession
func (*AccessBarrier) FlushSession ¶
func (ab *AccessBarrier) FlushSession(ref unsafe.Pointer)
func (*AccessBarrier) Release ¶
func (ab *AccessBarrier) Release(bs *BarrierSession)
type ActionBuffer ¶
type ActionBuffer struct {
// contains filtered or unexported fields
}
type BarrierSession ¶
type BarrierSession struct {
// contains filtered or unexported fields
}
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Concurrent bottom-up skiplist builder
func NewBuilder ¶
func NewBuilder() *Builder
func NewBuilderWithConfig ¶
func (*Builder) NewSegment ¶
func (*Builder) SetItemSizeFunc ¶
func (b *Builder) SetItemSizeFunc(fn ItemSizeFn)
type Config ¶
type Config struct { ItemSize ItemSizeFn UseMemoryMgmt bool Malloc MallocFn Free FreeFn BarrierDestructor BarrierSessionDestructor }
func DefaultConfig ¶
func DefaultConfig() Config
func (*Config) SetItemSizeFunc ¶
func (cfg *Config) SetItemSizeFunc(fn ItemSizeFn)
type ItemSizeFn ¶
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
func (*Iterator) SeekWithCmp ¶
type NodeCallback ¶
type NodeCallback func(*Node)
type Segment ¶
type Segment struct {
// contains filtered or unexported fields
}
func (*Segment) SetNodeCallback ¶
func (s *Segment) SetNodeCallback(fn NodeCallback)
type Skiplist ¶
func NewWithConfig ¶
func (*Skiplist) DeleteNode ¶
func (*Skiplist) FreeBuf ¶
func (s *Skiplist) FreeBuf(b *ActionBuffer)
func (*Skiplist) GetAccesBarrier ¶
func (s *Skiplist) GetAccesBarrier() *AccessBarrier
func (*Skiplist) GetRangeSplitItems ¶
Explicit barrier and release should be used by the caller before and after this function call
func (*Skiplist) GetStats ¶
func (s *Skiplist) GetStats() StatsReport
func (*Skiplist) MakeBuf ¶
func (s *Skiplist) MakeBuf() *ActionBuffer
func (*Skiplist) MemoryInUse ¶
func (*Skiplist) NewIterator ¶
func (s *Skiplist) NewIterator(cmp CompareFn, buf *ActionBuffer) *Iterator
type StatsReport ¶
type StatsReport struct { ReadConflicts uint64 InsertConflicts uint64 NextPointersPerNode float64 NodeDistribution [MaxLevel + 1]int64 NodeCount int SoftDeletes int64 Memory int64 NodeAllocs int64 NodeFrees int64 }
func (*StatsReport) Apply ¶
func (report *StatsReport) Apply(s *Stats)
func (StatsReport) String ¶
func (s StatsReport) String() string
Click to show internal directories.
Click to hide internal directories.