pebble

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIsNotDir = errors.New("is not a dir")

Functions

func CleanupNodeDataDir

func CleanupNodeDataDir(fs vfs.FS, dir string) error

CleanupNodeDataDir cleans up old data dir (should be called after successful switch).

func CreateNodeDataDir

func CreateNodeDataDir(fs vfs.FS, dir string) error

CreateNodeDataDir creates new SM data dir.

func DefaultOptions

func DefaultOptions() *pebble.Options

func GetCurrentDBDirName

func GetCurrentDBDirName(fs vfs.FS, dir string) (string, error)

GetCurrentDBDirName reads currentDBFilename file and return its contents.

func GetNewRandomDBDirName

func GetNewRandomDBDirName() string

GetNewRandomDBDirName gets new random DB dir name.

func GetNodeDBDirName

func GetNodeDBDirName(baseDir string, hostname string, name string) string

GetNodeDBDirName gets DB dir name prefix.

func IsNewRun

func IsNewRun(fs vfs.FS, dir string) bool

IsNewRun checks if the SM is created for the first time.

func OpenDB

func OpenDB(dbdir string, options ...Option) (*pebble.DB, error)

OpenDB opens DB on paths given (using sane defaults).

func ReplaceCurrentDBFile

func ReplaceCurrentDBFile(fs vfs.FS, dir string) error

ReplaceCurrentDBFile does currentDBFilename switch (with fsync).

func SaveCurrentDBDirName

func SaveCurrentDBDirName(fs vfs.FS, dir string, dbdir string) error

SaveCurrentDBDirName saves DB name into updatingDBFilename (with fsync).

func WriterOptions

func WriterOptions(level int) sstable.WriterOptions

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithCache

func WithCache(cache *pebble.Cache) Option

func WithEventListener

func WithEventListener(listener pebble.EventListener) Option

func WithFS

func WithFS(fs vfs.FS) Option

func WithLogger

func WithLogger(logger pebble.Logger) Option

func WithTableCache added in v0.2.0

func WithTableCache(cache *pebble.TableCache) Option

Jump to

Keyboard shortcuts

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