index

package
v0.0.0-...-6bb8025 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxCap = 1 << 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexIterator

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

func (*IndexIterator) Close

func (it *IndexIterator) Close()

func (*IndexIterator) Key

func (it *IndexIterator) Key() []byte

func (*IndexIterator) Next

func (it *IndexIterator) Next()

func (*IndexIterator) Rewind

func (it *IndexIterator) Rewind()

func (*IndexIterator) Seek

func (it *IndexIterator) Seek(key []byte)

func (*IndexIterator) Valid

func (it *IndexIterator) Valid() bool

func (*IndexIterator) Value

func (it *IndexIterator) Value() *datafile.DataPos

type IndexType

type IndexType = int8

IndexType 索引实现类型枚举

const (
	// BTree Btree B树索引
	BTree IndexType = iota + 1
	// SkipList 跳表索引
	SkipList
	// HashMap 哈希索引
	HashMap
)

type ShardedIndex

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

ShardedIndex 分片索引, 保证并发安全

func NewShardedIndex

func NewShardedIndex(typ IndexType, shardNum int) *ShardedIndex

func (*ShardedIndex) Close

func (s *ShardedIndex) Close() error

func (*ShardedIndex) Delete

func (s *ShardedIndex) Delete(key []byte) (*datafile.DataPos, bool)

func (*ShardedIndex) Get

func (s *ShardedIndex) Get(key []byte) *datafile.DataPos

func (*ShardedIndex) Iterator

func (s *ShardedIndex) Iterator(reverse bool) *IndexIterator

func (*ShardedIndex) Put

func (s *ShardedIndex) Put(key []byte, pos *datafile.DataPos) *datafile.DataPos

func (*ShardedIndex) Size

func (s *ShardedIndex) Size() int

Jump to

Keyboard shortcuts

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