Documentation
¶
Overview ¶
Package pebble provides an experimental, bounded-memory inode/dentry store. It does not yet replace compactfs's chunk-aware Namespace or volume backups.
Index ¶
- Variables
- type Attr
- type Entry
- type Options
- type Store
- func (s *Store) Close() error
- func (s *Store) Create(ctx context.Context, parent uint64, name string, attr Attr) (Attr, error)
- func (s *Store) Flush(ctx context.Context) error
- func (s *Store) GetAttr(ctx context.Context, inode uint64) (Attr, error)
- func (s *Store) Link(ctx context.Context, inode, parent uint64, name string) error
- func (s *Store) Lookup(ctx context.Context, parent uint64, name string) (Attr, error)
- func (s *Store) Metrics() (*pdb.Metrics, error)
- func (s *Store) ReadDir(ctx context.Context, parent uint64, cursor string, limit int) ([]Entry, error)
- func (s *Store) Rename(ctx context.Context, oldParent uint64, oldName string, newParent uint64, ...) error
- func (s *Store) Rmdir(ctx context.Context, parent uint64, name string) error
- func (s *Store) Sync(ctx context.Context) error
- func (s *Store) Unlink(ctx context.Context, parent uint64, name string) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Attr ¶
type Attr struct {
Inode, Parent, Size uint64
Mode, UID, GID uint32
Nlink uint32
Kind meta.Kind
Atime, Mtime, Ctime int64 // Unix nanoseconds
}
Attr is independent of dentry names. Parent is meaningful only on directories.
type Options ¶
type Options struct {
CacheBytes int64
MemTableBytes uint64
// NoSync acknowledges WAL writes before fsync. Call Sync before claiming
// durability. The default synchronizes every successful mutation.
NoSync bool
}
Options controls the two main memory consumers, not total process RSS.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) Metrics ¶
Metrics exposes block cache, WAL, MemTable and SST counters for experiments.
func (*Store) ReadDir ¶
func (s *Store) ReadDir(ctx context.Context, parent uint64, cursor string, limit int) ([]Entry, error)
ReadDir returns attributes from one snapshot, ordered strictly after cursor. The last returned Name is the next cursor. Empty output means EOF. Concurrent mutations can be visible on subsequent pages; no snapshot outlives this call.
func (*Store) Rename ¶
func (s *Store) Rename(ctx context.Context, oldParent uint64, oldName string, newParent uint64, newName string) error
Rename atomically replaces a compatible destination. Renaming either of two hard links to the same inode is a no-op. Directory parent/link-count changes and replacement retirement belong to the same indexed batch.