localvol

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OIDFromLocalID

func OIDFromLocalID(x ID) blobcache.OID

OIDFromLocalID maps a local volume ID to a Blobcache OID

Types

type Config

type Config struct {
	NoSync bool
}

type Env

type Env struct {
	DB       *pebble.DB
	BlobDir  *os.Root
	HSys     HandleSystem
	TxSys    *pdb.TxSys
	MkSchema func(blobcache.SchemaSpec) (schema.Schema, error)
}

type HandleSystem

type HandleSystem interface {
	Resolve(blobcache.Handle) (blobcache.OID, blobcache.ActionSet)
}

type ID

type ID uint64

ID uniquely identifies a local volume

func LocalIDFromOID

func LocalIDFromOID(oid blobcache.OID) (ID, error)

LocalIDFromOID maps an OID to a LocalID It reverses the mapping used by OIDFromLocalID

func ParseLocalID

func ParseLocalID(k []byte) (ID, error)

func (ID) Marshal

func (lvid ID) Marshal(out []byte) []byte

type LinkSet

type LinkSet = map[blobcache.OID]blobcache.ActionSet

type Params

type Params struct {
	ID     ID
	Params blobcache.VolumeConfig
}

type RefCount

type RefCount uint32

type System

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

System manages the local volumes and transactions on those volumes.

func New

func New(cfg Config, env Env) System

func (*System) Drop

func (ls *System) Drop(ctx context.Context, vol *Volume) error

func (*System) Flush

func (ls *System) Flush() error

func (*System) GCBlobs

func (ls *System) GCBlobs(ctx context.Context, lvid ID) error

GCBlobs walks all of the blob reference counts, and deletes any blobs that have a reference count of 0.

func (*System) GenerateLocalID

func (ls *System) GenerateLocalID() (ID, error)

func (*System) Up

func (ls *System) Up(ctx context.Context, params Params) (*Volume, error)

type Volume

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

func (*Volume) AccessSubVolume

func (v *Volume) AccessSubVolume(ctx context.Context, target blobcache.OID) (blobcache.ActionSet, error)

func (*Volume) Await

func (v *Volume) Await(ctx context.Context, prev []byte, next *[]byte) error

func (*Volume) BeginTx

func (v *Volume) BeginTx(ctx context.Context, tp blobcache.TxParams) (volumes.Tx, error)

func (*Volume) GetBackend

func (v *Volume) GetBackend() blobcache.VolumeBackend[blobcache.OID]

func (*Volume) GetParams

func (v *Volume) GetParams() blobcache.VolumeConfig

func (*Volume) ID

func (v *Volume) ID() ID
func (v *Volume) ReadLinks(ctx context.Context, dst volumes.LinkSet) error
type VolumeLink struct {
	From   ID
	To     blobcache.OID
	Rights blobcache.ActionSet
}
func ParseVolumeLink(k, v []byte) (VolumeLink, error)

ParseVolumeLink parses an entry from the LOCAL_VOLUME_LINKS table.

Jump to

Keyboard shortcuts

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