Documentation
¶
Index ¶
- type AdaptiveRadixTree
- func (art *AdaptiveRadixTree) Close() error
- func (art *AdaptiveRadixTree) Delete(key []byte) (*data.Position, bool)
- func (art *AdaptiveRadixTree) Get(key []byte) *data.Position
- func (art *AdaptiveRadixTree) Iterator(reverse bool) Iterator
- func (art *AdaptiveRadixTree) Put(key []byte, pos *data.Position) *data.Position
- func (art *AdaptiveRadixTree) Size() int
- type BPlusTree
- func (bpt *BPlusTree) Close() error
- func (bpt *BPlusTree) Delete(key []byte) (*data.Position, bool)
- func (bpt *BPlusTree) Get(key []byte) *data.Position
- func (bpt *BPlusTree) Iterator(reverse bool) Iterator
- func (bpt *BPlusTree) Put(key []byte, pos *data.Position) *data.Position
- func (bpt *BPlusTree) Size() int
- type BTree
- type IndexType
- type Indexer
- type Item
- type Iterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdaptiveRadixTree ¶
type AdaptiveRadixTree struct {
// contains filtered or unexported fields
}
func (*AdaptiveRadixTree) Close ¶
func (art *AdaptiveRadixTree) Close() error
func (*AdaptiveRadixTree) Delete ¶
func (art *AdaptiveRadixTree) Delete(key []byte) (*data.Position, bool)
func (*AdaptiveRadixTree) Iterator ¶
func (art *AdaptiveRadixTree) Iterator(reverse bool) Iterator
Iterator 索引迭代器
func (*AdaptiveRadixTree) Size ¶
func (art *AdaptiveRadixTree) Size() int
type BPlusTree ¶
type BPlusTree struct {
// contains filtered or unexported fields
}
BPlusTree B+树索引,将索引存储到磁盘上
func NewBPlusTree ¶
type BTree ¶
type BTree struct {
// contains filtered or unexported fields
}
type Indexer ¶
type Indexer interface {
// Put 向索引中存储 key 对应的数据位置信息
Put(key []byte, pos *data.Position) *data.Position
// Get 根据 key 取出对应的索引位置信息
Get(key []byte) *data.Position
// Delete 根据 key 删除对应的索引位置信息
Delete(key []byte) (*data.Position, bool)
// Iterator 索引迭代器
Iterator(reverse bool) Iterator
// Size 索引中的数据量
Size() int
Close() error
}
type Iterator ¶
type Iterator interface {
// Rewind 重新回到迭代器的起点,即第一个数据
Rewind()
// Seek 根据传入的 key 查找到第一个大于(或小于)等于的目标 key,根据从这个 key 开始遍历
Seek(key []byte)
// Next 跳转到下一个 key
Next()
// Valid 是否有效,即是否已经遍历完了所有的 key,用于退出遍历
Valid() bool
// Key 当前遍历位置的 Key 数据
Key() []byte
// Value 当前遍历位置的 Value 数据
Value() *data.Position
// Close 关闭迭代器,释放相应资源
Close()
}
Iterator 通用索引迭代器
Click to show internal directories.
Click to hide internal directories.