Documentation
¶
Index ¶
- Variables
- type CursorItem
- type Iterator
- func (it *Iterator) Close() error
- func (it *Iterator) Domain() (start, end []byte)
- func (it *Iterator) Error() error
- func (it *Iterator) IsDeleted() bool
- func (it *Iterator) Key() []byte
- func (it *Iterator) KeyCopy(dst []byte) []byte
- func (it *Iterator) Next()
- func (it *Iterator) Seek(key []byte)
- func (it *Iterator) UnsafeEntry() ([]byte, page.ValuePtr, byte)
- func (it *Iterator) UnsafeKey() []byte
- func (it *Iterator) UnsafeValue() []byte
- func (it *Iterator) Valid() bool
- func (it *Iterator) Value() []byte
- func (it *Iterator) ValueCopy(dst []byte) []byte
- type SlabReader
- type Tree
- func (t *Tree) CollectPageIDs() ([]uint64, error)
- func (t *Tree) Get(key []byte) ([]byte, error)
- func (t *Tree) GetEntry(key []byte) (node.LeafEntry, error)
- func (t *Tree) GetUnsafe(key []byte) ([]byte, error)
- func (t *Tree) Has(key []byte) (bool, error)
- func (t *Tree) Iterator(start, end []byte) iterator.UnsafeIterator
- func (t *Tree) Reset(p *pager.Pager, sr SlabReader, root uint64)
- func (t *Tree) ReverseIterator(start, end []byte) iterator.UnsafeIterator
- func (t *Tree) SetRoot(root uint64)
- func (t *Tree) UpdateValuePtrInPlace(key []byte, oldPtr, newPtr page.ValuePtr) (updated bool, leafPageID uint64, err error)
- func (t *Tree) WalkPages(fn func(pageID uint64, n node.Node) error) error
Constants ¶
This section is empty.
Variables ¶
var ErrKeyNotFound = errors.New("key not found")
Functions ¶
This section is empty.
Types ¶
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
func (*Iterator) UnsafeValue ¶
type SlabReader ¶
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
func (*Tree) CollectPageIDs ¶
CollectPageIDs returns the set of page IDs reachable from the Tree root. The returned slice is sorted.
func (*Tree) GetEntry ¶
GetEntry returns the raw leaf entry (useful for compaction/CAS). CAUTION: Returned entry Key/Value might point directly to mmap memory. Do not modify or hold reference for long.
func (*Tree) Reset ¶
func (t *Tree) Reset(p *pager.Pager, sr SlabReader, root uint64)
Reset re-initializes the tree with new parameters for reuse.
func (*Tree) ReverseIterator ¶
func (t *Tree) ReverseIterator(start, end []byte) iterator.UnsafeIterator
func (*Tree) UpdateValuePtrInPlace ¶
func (t *Tree) UpdateValuePtrInPlace(key []byte, oldPtr, newPtr page.ValuePtr) (updated bool, leafPageID uint64, err error)
UpdateValuePtrInPlace rewrites a pointer value in-place inside the current tree by updating the leaf page that contains key.
This is intended for maintenance operations (e.g. value-log compaction) that want to avoid full copy-on-write path rewrites. Callers must ensure snapshot safety (i.e. no readers are pinned to the current index generation) before using it.
Returns (updated=true, leafPageID) when the entry existed as a pointer and matched oldPtr. If the key is missing or has changed since oldPtr, it returns updated=false with a nil error.