go_tsmm

package module
v1.0.0-test.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValueSize = 13
	HashSize  = 20
)
View Source
const (
	BTreePageFileIndex = "index"
)
View Source
const DefaultFillPercent = 0.5

DefaultFillPercent is the percentage that split pages are filled. This value can be changed by setting Bucket.FillPercent.

Variables

View Source
var (
	// ErrorKeyNotFound 错误定义
	ErrorKeyNotFound = errors.New("key not found")
)

Functions

func Sync

func Sync(condition bool, f func() error) error

Types

type BTree

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

func NewBTree

func NewBTree(isReadOnly bool, isSubBTree bool, noSync bool,
	baseBTreePath string,
	compressType string,
	activateMetaVersion int,
	seq uint64, name string, pgId common.Pgid, overflow uint32) (*BTree, error)

func (*BTree) Delete

func (b *BTree) Delete(key []byte) error

func (*BTree) EnableCompress

func (b *BTree) EnableCompress() bool

func (*BTree) Put

func (b *BTree) Put(key, value []byte) error

func (*BTree) Update

func (b *BTree) Update() error

type Batch

type Batch interface {
	Put(key []byte, value []byte) error
	Get(key []byte) ([]byte, error)
	Delete(key []byte) error
	Size() int
	Dump() KVS
}

Batch BTree Put Buffer

type Iterator

type Iterator interface {
	Key() []byte
	Value() []byte
	Get(key []byte) ([]byte, error)
	Seek(key []byte) bool
	Next() bool
	Error() error
	Last() bool
	Prev() bool
	First() bool
}

type MetaData

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

type MetaMgr

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

func NewMetaMgr

func NewMetaMgr(metaFilePath string, activateVersionNum int, noSync bool) (*MetaMgr, error)

func (*MetaMgr) ReadMeta

func (mm *MetaMgr) ReadMeta(metaID uint64, data []byte) (*common.Meta, error)

func (*MetaMgr) Write

func (mm *MetaMgr) Write(meta *common.Meta) error

Write 对于持久化的 meta 进行写入, 树上的活跃版本 不在这里写入 v=10 0,1,2,3,4,5,6,7,8,9 10,12,13,14,15,16,17,18,19

type PageMgr

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

func NewPageMgr

func NewPageMgr(pageFilePath string, noSync bool) (*PageMgr, error)

func (*PageMgr) ReadAt

func (pm *PageMgr) ReadAt(pid common.Pgid, overflow uint32) (*common.Page, error)

func (*PageMgr) Write

func (pm *PageMgr) Write(page *common.Page) error

type SkipList

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

func NewSkipList

func NewSkipList() *SkipList

func (*SkipList) Delete

func (s *SkipList) Delete(key []byte) error

func (*SkipList) Dump

func (s *SkipList) Dump() common.Inodes

func (*SkipList) Get

func (s *SkipList) Get(key []byte) ([]byte, error)

func (*SkipList) Put

func (s *SkipList) Put(key []byte, value []byte) error

func (*SkipList) Size

func (s *SkipList) Size() int

Directories

Path Synopsis
Package errors defines the error variables that may be returned during bbolt operations.
Package errors defines the error variables that may be returned during bbolt operations.
internal

Jump to

Keyboard shortcuts

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