pebble

package
v1.10.14 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConfig = Config{
		CacheSize:                   defaultCacheSize,
		BytesPerSync:                512 * units.KiB,
		WALBytesPerSync:             0,
		MemTableStopWritesThreshold: 8,
		MemTableSize:                defaultCacheSize / 4,
		MaxOpenFiles:                4096,
		MaxConcurrentCompactions:    1,
	}

	DefaultConfigBytes []byte
)

Functions

This section is empty.

Types

type Config

type Config struct {
	CacheSize                   int `json:"cacheSize"`
	BytesPerSync                int `json:"bytesPerSync"`
	WALBytesPerSync             int `json:"walBytesPerSync"` // 0 means no background syncing
	MemTableStopWritesThreshold int `json:"memTableStopWritesThreshold"`
	MemTableSize                int `json:"memTableSize"`
	MaxOpenFiles                int `json:"maxOpenFiles"`
	MaxConcurrentCompactions    int `json:"maxConcurrentCompactions"`
}

type Database

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

func New

func New(file string, configBytes []byte, log logging.Logger, _ string, _ prometheus.Registerer) (*Database, error)

TODO: Add metrics

func (*Database) Close

func (db *Database) Close() error

func (*Database) Compact

func (db *Database) Compact(start []byte, end []byte) error

func (*Database) Delete

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

func (*Database) Get

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

func (*Database) Has

func (db *Database) Has(key []byte) (bool, error)

func (*Database) HealthCheck

func (db *Database) HealthCheck(_ context.Context) (interface{}, error)

func (*Database) NewBatch

func (db *Database) NewBatch() database.Batch

func (*Database) NewIterator

func (db *Database) NewIterator() database.Iterator

func (*Database) NewIteratorWithPrefix

func (db *Database) NewIteratorWithPrefix(prefix []byte) database.Iterator

func (*Database) NewIteratorWithStart

func (db *Database) NewIteratorWithStart(start []byte) database.Iterator

func (*Database) NewIteratorWithStartAndPrefix

func (db *Database) NewIteratorWithStartAndPrefix(start, prefix []byte) database.Iterator

func (*Database) Put

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

Jump to

Keyboard shortcuts

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