pool

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package pool provides components to work with storage pools.

Package pool provides components to work with storage pools.

Package pool provides components to work with storage pools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cloner

type Cloner interface {
	CreateClone(name, snapshotID string) error
	DestroyClone(name string) error
	ListClonesNames() ([]string, error)
}

Cloner describes methods of clone management.

type Config

type Config struct {
	MountDir          string `yaml:"mountDir"`
	CloneSubDir       string `yaml:"clonesMountSubDir"`
	DataSubDir        string `yaml:"dataSubDir"`
	SocketSubDir      string `yaml:"socketSubDir"`
	ObserverSubDir    string `yaml:"observerSubDir"`
	PreSnapshotSuffix string `yaml:"preSnapshotSuffix"`
	SelectedPool      string `yaml:"selectedPool"`
}

Config defines a config of a pool manager.

type FSManager

type FSManager interface {
	Cloner
	Snapshotter
	StateReporter
	Pooler
}

FSManager defines an interface to work different thin-clone managers.

func NewManager

func NewManager(runner runners.Runner, config ManagerConfig) (FSManager, error)

NewManager defines constructor for thin-clone managers.

type Manager

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

Manager describes a pool manager.

func NewPoolManager

func NewPoolManager(cfg *Config, runner runners.Runner) *Manager

NewPoolManager creates a new pool manager.

func (*Manager) CollectPoolStat

func (pm *Manager) CollectPoolStat() telemetry.PoolStat

CollectPoolStat collects pool stats.

func (*Manager) First

func (pm *Manager) First() FSManager

First returns the first active storage pool manager.

func (*Manager) GetActiveFSManagers

func (pm *Manager) GetActiveFSManagers() []FSManager

GetActiveFSManagers returns a list of active filesystem managers.

func (*Manager) GetFSManager

func (pm *Manager) GetFSManager(name string) (FSManager, error)

GetFSManager returns a filesystem manager by name if exists.

func (*Manager) GetFSManagerList

func (pm *Manager) GetFSManagerList() []FSManager

GetFSManagerList returns a filesystem manager list.

func (*Manager) GetFSManagerOrderedList

func (pm *Manager) GetFSManagerOrderedList() []FSManager

GetFSManagerOrderedList returns a filesystem manager list in the order of the queue.

func (*Manager) GetPoolByName

func (pm *Manager) GetPoolByName(poolName string) *list.Element

GetPoolByName returns element by pool name.

func (*Manager) GetPoolToUpdate

func (pm *Manager) GetPoolToUpdate() *list.Element

GetPoolToUpdate returns element to update.

func (*Manager) MakeActive

func (pm *Manager) MakeActive(element *list.Element)

MakeActive marks element as active pool and moves it to the head of the pool list.

func (*Manager) Reload

func (pm *Manager) Reload(cfg Config) error

Reload reloads pool manager configuration.

func (*Manager) ReloadPools

func (pm *Manager) ReloadPools() error

ReloadPools updates available pool managers.

type ManagerConfig

type ManagerConfig struct {
	Pool              *resources.Pool
	PreSnapshotSuffix string
}

ManagerConfig defines thin-clone manager config.

type Pooler

type Pooler interface {
	Pool() *resources.Pool
}

Pooler describes methods for Pool providing.

type Snapshotter

type Snapshotter interface {
	CreateSnapshot(poolSuffix, dataStateAt string) (snapshotName string, err error)
	DestroySnapshot(snapshotName string) (err error)
	CleanupSnapshots(retentionLimit int) ([]string, error)
	GetSnapshots() ([]resources.Snapshot, error)
}

Snapshotter describes methods of snapshot management.

type StateReporter

type StateReporter interface {
	GetSessionState(name string) (*resources.SessionState, error)
	GetFilesystemState() (models.FileSystem, error)
}

StateReporter describes methods of state reporting.

Jump to

Keyboard shortcuts

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