db

package
v1.34.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLRUCache = 256 << 20 // 256 M
)

Variables

View Source
var (
	ErrStopped         = errors.New("db: err stopped")
	ErrShardMetaNotDir = errors.New("db: shard meta not directory")
	ErrWrongConfig     = errors.New("db: wrong config item")
)

Functions

This section is empty.

Types

type MetaConfig

type MetaConfig struct {
	MetaRootPrefix     string `json:"meta_root_prefix"`
	SupportInline      bool   `json:"support_inline"`
	TinyFileThresholdB int    `json:"tinyfile_threshold_B"`
	Sync               bool   `json:"sync"`
	LRUCacheSize       uint64 `json:"cache_size"`
}

type MetaHandler

type MetaHandler interface {
	Get(ctx context.Context, key []byte) ([]byte, error)
	Put(ctx context.Context, kv rdb.KV) error
	Delete(ctx context.Context, key []byte) error
	DeleteRange(ctx context.Context, start, end []byte) error
	Flush(ctx context.Context) error
	NewIterator(ctx context.Context, opts ...rdb.OpOption) rdb.Iterator
	SetHandleIOError(handler func(err error))
	Close(ctx context.Context) error
}

func NewMetaHandler

func NewMetaHandler(dirpath string, config MetaConfig) (mh MetaHandler, err error)

Jump to

Keyboard shortcuts

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