engine

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 16 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB bitcask Storage engine instance

func NewDB

func NewDB(options config.Options) (*DB, error)

NewDB open a new db instance

func (*DB) Close

func (db *DB) Close() error

Close the db instance

func (*DB) Delete

func (db *DB) Delete(key []byte) error

func (*DB) Fold

func (db *DB) Fold(f func(key []byte, value []byte) bool) error

Fold Get all the data and perform the operation specified by the user. The function returns false to exit

func (*DB) Get

func (db *DB) Get(key []byte) ([]byte, error)

Get Read data according to the key

func (*DB) GetListKeys

func (db *DB) GetListKeys() [][]byte

GetListKeys Gets all the keys in the database

func (*DB) Merge

func (db *DB) Merge() error

Merge 清理无效数据,生成 hint 索引文件

func (*DB) NewIterator

func (db *DB) NewIterator(opt config.IteratorOptions) *Iterator

NewIterator 初始化迭代器

func (*DB) NewWriteBatch

func (db *DB) NewWriteBatch(opt config.WriteBatchOptions) *WriteBatch

NewWriteBatch Init WriteBatch

func (*DB) Put

func (db *DB) Put(key []byte, value []byte) error

Put write a key-value pair to db, and the key must be not empty

func (*DB) Sync

func (db *DB) Sync() error

Sync the db instance

type Iterator

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

Iterator 迭代器

func (*Iterator) Close

func (it *Iterator) Close()

func (*Iterator) Key

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

func (*Iterator) Next

func (it *Iterator) Next()

func (*Iterator) Rewind

func (it *Iterator) Rewind()

func (*Iterator) Seek

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

func (*Iterator) Valid

func (it *Iterator) Valid() bool

func (*Iterator) Value

func (it *Iterator) Value() ([]byte, error)

type WriteBatch

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

WriteBatch Writes data in atomic batches to ensure atomicity

func (*WriteBatch) Commit

func (wb *WriteBatch) Commit() error

Commit The transaction commits, writes the transient data to the data file, and updates the in-memory index

func (*WriteBatch) Delete

func (wb *WriteBatch) Delete(key []byte) error

Delete Batch deletion of data

func (*WriteBatch) Put

func (wb *WriteBatch) Put(key []byte, value []byte) error

Put Data batch write

Jump to

Keyboard shortcuts

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