localvol

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OIDFromLocalID

func OIDFromLocalID(key *[16]byte, 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
	TxSys    *pdb.TxSys
	MkSchema func(blobcache.SchemaSpec) (schema.Schema, error)
}

type ID

type ID uint64

ID uniquely identifies a local volume

func LocalIDFromOID

func LocalIDFromOID(key *[16]byte, 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 Params

type Params = bcsys.LVParams[ID]

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) 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) UpNoErr added in v0.0.3

func (ls *System) UpNoErr(params Params) *Volume

UpNoErr is like Up, but it always succeeds. Up implements volume.System.Up, but this implementation never errors, and doesn't need the context.

func (*System) VolumeDestroy added in v0.4.0

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

func (*System) VolumeUp added in v0.4.0

func (ls *System) VolumeUp(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, lt blobcache.LinkToken) (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) (backend.Tx, error)

func (*Volume) Down added in v0.8.0

func (v *Volume) Down(ctx context.Context) error

func (*Volume) GetBackend

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

func (*Volume) GetParams

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

func (*Volume) Key added in v0.0.3

func (v *Volume) Key() ID
func (v *Volume) ReadLinks(ctx context.Context, dst backend.LinkSet) error
type VolumeLink struct {
	From ID
	To   blobcache.OID
	Hash [32]byte
}
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