datadir

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupOrphanedOverlayMounts

func CleanupOrphanedOverlayMounts(ctx context.Context, log logrus.FieldLogger, mounts []OrphanedOverlayMount) error

CleanupOrphanedOverlayMounts unmounts and removes orphaned overlay directories.

func CleanupOrphanedZFSResources

func CleanupOrphanedZFSResources(ctx context.Context, log logrus.FieldLogger, resources []ZFSOrphanedResource) error

CleanupOrphanedZFSResources removes orphaned ZFS clones and snapshots. Clones must be destroyed before their parent snapshots.

Types

type CopyProvider

type CopyProvider interface {
	Provider
}

CopyProvider implements Provider using parallel file copying. It collects all files first, then uses multiple workers to copy them concurrently.

func NewCopyProvider

func NewCopyProvider(log logrus.FieldLogger) CopyProvider

NewCopyProvider creates a new parallel copy provider.

type FuseOverlayFSProvider

type FuseOverlayFSProvider interface {
	Provider
}

FuseOverlayFSProvider implements Provider using fuse-overlayfs. It provides unprivileged overlay filesystem support via FUSE, the same approach used by rootless Podman/Docker.

func NewFuseOverlayFSProvider

func NewFuseOverlayFSProvider(log logrus.FieldLogger) FuseOverlayFSProvider

NewFuseOverlayFSProvider creates a new fuse-overlayfs provider.

type OrphanedOverlayMount

type OrphanedOverlayMount struct {
	MountPoint string // The merged directory mount point
	BaseDir    string // The parent temp directory
	Type       string // "overlayfs" or "fuse-overlayfs"
}

OrphanedOverlayMount represents an orphaned overlay filesystem mount.

func ListOrphanedOverlayMounts

func ListOrphanedOverlayMounts(ctx context.Context) ([]OrphanedOverlayMount, error)

ListOrphanedOverlayMounts finds overlay and fuse-overlayfs mounts created by benchmarkoor. These may be left behind if the process was killed before cleanup.

type OverlayFSProvider

type OverlayFSProvider interface {
	Provider
}

OverlayFSProvider implements Provider using Linux overlayfs. It creates a union filesystem with the source as a read-only lower layer and a writable upper layer, avoiding the need to copy data.

func NewOverlayFSProvider

func NewOverlayFSProvider(log logrus.FieldLogger) OverlayFSProvider

NewOverlayFSProvider creates a new OverlayFS provider.

type PreparedDir

type PreparedDir struct {
	MountPath string
	Cleanup   func() error
}

PreparedDir represents a prepared data directory ready for mounting.

type Provider

type Provider interface {
	// Prepare prepares the data directory and returns a PreparedDir.
	Prepare(ctx context.Context, cfg *ProviderConfig) (*PreparedDir, error)
}

Provider prepares a data directory and returns the mount path.

func NewProvider

func NewProvider(log logrus.FieldLogger, method string) (Provider, error)

NewProvider creates a new Provider based on the method. Supported methods: "copy" (default), "overlayfs", "fuse-overlayfs", "zfs".

type ProviderConfig

type ProviderConfig struct {
	SourceDir  string
	InstanceID string
	TmpDir     string
}

ProviderConfig contains configuration for preparing a data directory.

type ZFSOrphanedResource

type ZFSOrphanedResource struct {
	Name string // Full resource name (dataset or snapshot)
	Type string // "clone" or "snapshot"
}

ZFSOrphanedResource represents an orphaned ZFS resource created by benchmarkoor.

func ListOrphanedZFSResources

func ListOrphanedZFSResources(ctx context.Context) ([]ZFSOrphanedResource, error)

ListOrphanedZFSResources finds ZFS clones and snapshots created by benchmarkoor. These may be left behind if the process was killed before cleanup.

type ZFSProvider

type ZFSProvider interface {
	Provider
}

ZFSProvider implements Provider using ZFS snapshots and clones. It creates an instant, copy-on-write clone of the source dataset, providing near-instant data directory preparation without copying.

func NewZFSProvider

func NewZFSProvider(log logrus.FieldLogger) ZFSProvider

NewZFSProvider creates a new ZFS provider.

Jump to

Keyboard shortcuts

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