Documentation
¶
Overview ¶
Package nodetable implements high performance GC optimized Node lookup table for Nitro index storage. This table is not thread-safe
Golang map does not need to pay the cost of GC scans if you have native fixed size types for both key and value. We use two tables for the node lookup table implementation. Fast table and slow table. Fast table stores maps crc32(key) to a uint64. Value is a pointer to a skiplist node. Highest bit is used to indicate whether there is any hash collision for the crc32 key used. If the bit is set, that means we need to lookup second table, which is the slow table. Slow table has multiple entries which are mapped by the same crc32 key.
Index ¶
- func CompareNodeTable(a, b unsafe.Pointer) int
- func MemoryInUse() (sz int64)
- type EqualKeyFn
- type HashFn
- type NodeTable
- func (nt *NodeTable) Close()
- func (nt *NodeTable) Get(key []byte) unsafe.Pointer
- func (nt *NodeTable) MemoryInUse() int64
- func (nt *NodeTable) Remove(key []byte) (success bool, nptr unsafe.Pointer)
- func (nt *NodeTable) Stats() string
- func (nt *NodeTable) Update(key []byte, nptr unsafe.Pointer) (updated bool, oldPtr unsafe.Pointer)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareNodeTable ¶
CompareNodeTable implements comparator for nodetable instances
Types ¶
type EqualKeyFn ¶
EqualKeyFn implements key equality check
type NodeTable ¶
type NodeTable struct {
// contains filtered or unexported fields
}
NodeTable describes lookup table
func (*NodeTable) Get ¶
Get returns node pointer for the lookup key
func (*NodeTable) MemoryInUse ¶
MemoryInUse returns memory used by nodetable instance
func (*NodeTable) Remove ¶
Remove an item from the nodetable
Source Files
¶
- table.go