badger

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2025 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SortBySize  = "size"  // Constant to specify sorting by size
	SortByCount = "count" // Constant to specify sorting by count
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ByCount added in v1.1.2

type ByCount []*KeyStats

ByCount implements sort.Interface to sort KeyStats by the occurrence count of each key.

func (ByCount) Len added in v1.1.2

func (a ByCount) Len() int

func (ByCount) Less added in v1.1.2

func (a ByCount) Less(i, j int) bool

func (ByCount) Swap added in v1.1.2

func (a ByCount) Swap(i, j int)

type BySize added in v1.1.2

type BySize []*KeyStats

BySize implements sort.Interface to sort KeyStats by the size of the value for each key.

func (BySize) Len added in v1.1.2

func (a BySize) Len() int

func (BySize) Less added in v1.1.2

func (a BySize) Less(i, j int) bool

func (BySize) Swap added in v1.1.2

func (a BySize) Swap(i, j int)

type Config

type Config struct {
	Enabled bool `config:"enabled"`

	SingleBucketMode   bool   `config:"single_bucket_mode"`
	Path               string `config:"path"`
	InMemoryMode       bool   `config:"memory_mode"`
	SyncWrites         bool   `config:"sync_writes"`
	MemTableSize       int64  `config:"mem_table_size"`
	ValueLogFileSize   int64  `config:"value_log_file_size"`
	ValueThreshold     int64  `config:"value_threshold"`
	ValueLogMaxEntries uint32 `config:"value_log_max_entries"`
	NumMemtables       int    `config:"num_mem_tables"`

	NumLevelZeroTables      int `config:"num_level0_tables"`
	NumLevelZeroTablesStall int `config:"num_level0_tables_stall"`

	ValueLogGCEnabled           bool    `config:"value_log_gc_enabled"`
	ValueLogDiscardRatio        float64 `config:"value_log_gc_discard_ratio"`
	ValueLogGCIntervalInSeconds int     `config:"value_log_gc_interval_in_seconds"`
}

type KeyStats added in v1.1.2

type KeyStats struct {
	Key   string // The key itself
	Count int    // The number of times the key appears in the database
	Size  int64  // The size of the key's associated value
}

KeyStats represents the statistics for each key, including its occurrence count and value size.

type Module

type Module struct {
	api.Handler
	// contains filtered or unexported fields
}

func (*Module) Add

func (filter *Module) Add(bucket string, key []byte) error

func (*Module) AddValue

func (filter *Module) AddValue(bucket string, key []byte, value []byte) error

func (*Module) AddValueCompress

func (filter *Module) AddValueCompress(bucket string, key []byte, value []byte) error

func (*Module) CheckThenAdd

func (filter *Module) CheckThenAdd(bucket string, key []byte) (b bool, err error)

func (*Module) Close

func (filter *Module) Close() error

func (*Module) Delete

func (filter *Module) Delete(bucket string, key []byte) error

func (*Module) DeleteKey

func (filter *Module) DeleteKey(bucket string, key []byte) error

func (*Module) Exists

func (filter *Module) Exists(bucket string, key []byte) bool

func (*Module) ExistsKey

func (filter *Module) ExistsKey(bucket string, key []byte) (bool, error)

func (*Module) GetCompressedValue

func (filter *Module) GetCompressedValue(bucket string, key []byte) ([]byte, error)

func (*Module) GetValue

func (filter *Module) GetValue(bucket string, key []byte) ([]byte, error)

for kv implementation

func (*Module) Name

func (module *Module) Name() string

func (*Module) Open

func (filter *Module) Open() error

func (*Module) Setup

func (module *Module) Setup()

func (*Module) Start

func (module *Module) Start() error

func (*Module) Stop

func (module *Module) Stop() error

Jump to

Keyboard shortcuts

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