allocation

package
v0.0.0-...-24f08a5 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package allocation implements routines for allocation of schema.Moveable to a disk array, more specifically all included schema.Disk of a schema.Share.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotAllocatable is an error that is returned when no allocation is
	// possible.
	ErrNotAllocatable = errors.New("no suitable destination for allocation method")

	// ErrSplitDoesNotExceedLvl is a sentinel error that is returned for
	// situational error handling, it is to exclude [schema.Moveable] not
	// relevant to split level.
	ErrSplitDoesNotExceedLvl = errors.New("split level does not exceed max split level")

	// ErrNoAllocationMethod is an error that should not be possible under
	// normal circumstances, it is returned for misconfigurations and non
	// supported allocation methods.
	ErrNoAllocationMethod = errors.New("no allocation method given in configuration")

	// ErrNoDiskStats is returned when no disk statistics were able to be
	// obtained, it is typically only seen during severe malfunctions of the
	// operating system.
	ErrNoDiskStats = errors.New("failed getting stats for any disk")

	// ErrCalcSplitLvlZero is returned when the split level calculated on a
	// moveable is zero, which should never be possible since we are operating
	// on full paths.
	ErrCalcSplitLvlZero = errors.New("calc split level of zero")
)

Functions

This section is empty.

Types

type Handler

type Handler struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Handler is the principal implementation for the allocation services. It is safe for concurrent use on unique, non-concurrent schema.Moveable.

func NewHandler

func NewHandler(fsHandler fsProvider) *Handler

NewHandler returns a pointer to a new allocation Handler.

func (*Handler) AllocateArrayDestination

func (a *Handler) AllocateArrayDestination(m *schema.Moveable) bool

AllocateArrayDestination allocates a schema.Moveable and its subelements to a schema.Share's included disks (which are typically part of an array).

It is the principal method used allocating given schema.Moveable, where the destination field has not yet been set, to target schema.Disk (of an array).

Jump to

Keyboard shortcuts

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