pebble

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2025 License: MIT Imports: 18 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 NewPebbleFS

func NewPebbleFS(fs gvfs.FS) pvfs.FS

NewPebbleFS creates a new pebble/vfs.FS instance.

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 ConcurrencyLimitScheduler

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

func NewConcurrencyLimitScheduler

func NewConcurrencyLimitScheduler() *ConcurrencyLimitScheduler

func (*ConcurrencyLimitScheduler) CumulativeStats

func (*ConcurrencyLimitScheduler) Done

func (s *ConcurrencyLimitScheduler) Done()

func (*ConcurrencyLimitScheduler) MeasureCPU

func (*ConcurrencyLimitScheduler) Register

func (s *ConcurrencyLimitScheduler) Register(numGoroutinesPerCompaction int, db pebble.DBForCompaction)

func (*ConcurrencyLimitScheduler) Started

func (s *ConcurrencyLimitScheduler) Started()

func (*ConcurrencyLimitScheduler) TrySchedule

func (*ConcurrencyLimitScheduler) Unregister

func (s *ConcurrencyLimitScheduler) Unregister()

func (*ConcurrencyLimitScheduler) UpdateGetAllowedWithoutPermission

func (s *ConcurrencyLimitScheduler) UpdateGetAllowedWithoutPermission()

type FS

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

FS is a wrapper struct that implements the pebble/vfs.FS interface.

func (*FS) Create

func (p *FS) Create(name string, category pvfs.DiskWriteCategory) (pvfs.File, error)

Create ...

func (*FS) GetDiskUsage

func (p *FS) GetDiskUsage(path string) (pvfs.DiskUsage, error)

GetDiskUsage ...

func (p *FS) Link(oldname, newname string) error

Link ...

func (*FS) List

func (p *FS) List(dir string) ([]string, error)

List ...

func (*FS) Lock

func (p *FS) Lock(name string) (io.Closer, error)

Lock ...

func (*FS) MkdirAll

func (p *FS) MkdirAll(dir string, perm os.FileMode) error

MkdirAll ...

func (*FS) Open

func (p *FS) Open(name string, opts ...pvfs.OpenOption) (pvfs.File, error)

Open ...

func (*FS) OpenDir

func (p *FS) OpenDir(name string) (pvfs.File, error)

OpenDir ...

func (*FS) OpenReadWrite

func (p *FS) OpenReadWrite(name string, category pvfs.DiskWriteCategory, opts ...pvfs.OpenOption) (pvfs.File, error)

func (*FS) PathBase

func (p *FS) PathBase(path string) string

PathBase ...

func (*FS) PathDir

func (p *FS) PathDir(path string) string

PathDir ...

func (*FS) PathJoin

func (p *FS) PathJoin(elem ...string) string

PathJoin ...

func (*FS) Remove

func (p *FS) Remove(name string) error

Remove ...

func (*FS) RemoveAll

func (p *FS) RemoveAll(name string) error

RemoveAll ...

func (*FS) Rename

func (p *FS) Rename(oldname, newname string) error

Rename ...

func (*FS) ReuseForWrite

func (p *FS) ReuseForWrite(oldname, newname string, category pvfs.DiskWriteCategory) (pvfs.File, error)

ReuseForWrite ...

func (*FS) Stat

func (p *FS) Stat(name string) (pvfs.FileInfo, error)

Stat ...

func (*FS) Unwrap

func (p *FS) Unwrap() pvfs.FS

type Option

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

func WithCache

func WithCache(cache *pebble.Cache) Option

func WithCompactionScheduler

func WithCompactionScheduler(scheduler pebble.CompactionScheduler) 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

Jump to

Keyboard shortcuts

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