index

package
v0.0.0-...-3144fe6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BTree

type BTree struct {
	// contains filtered or unexported fields
}

BTree 索引 主要封装了 google 的 btree kv

func NewBTree

func NewBTree() *BTree

NewBTree 初始化 BTree 索引结构

func (*BTree) Delete

func (bt *BTree) Delete(key []byte) bool

func (*BTree) Get

func (bt *BTree) Get(key []byte) *data.LogRecordPos

func (*BTree) Put

func (bt *BTree) Put(key []byte, pos *data.LogRecordPos) bool

type IndexType

type IndexType = int8
const (
	// Btree 索引
	Btree IndexType = iota + 1

	// ART 自适应基数树索引
	ART
)

type Indexer

type Indexer interface {
	// Put 向索引中存储 key 对应的数据位置信息
	Put(key []byte, pos *data.LogRecordPos) bool

	// Get 根据 key 取出对应的索引位置信息
	Get(key []byte) *data.LogRecordPos

	// Delete 根据 key 删除对应的索引位置信息
	Delete(key []byte) bool
}

Indexer 抽象索引接口,后续如果想要接入其它的数据结构,直接实现这个接口

func NewIndexer

func NewIndexer(typ IndexType) Indexer

type Item

type Item struct {
	// contains filtered or unexported fields
}

func (*Item) Less

func (ai *Item) Less(bi btree.Item) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址