pool

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: AGPL-3.0 Imports: 20 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

View Source
const (
	// ZFS defines the zfs filesystem name.
	ZFS = "zfs"
	// LVM defines the lvm filesystem name.
	LVM = "lvm"
)

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"`
}

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) Active

func (pm *Manager) Active() FSManager

Active returns the active storage pool manager.

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) GetPoolToUpdate

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

GetPoolToUpdate returns the element to update.

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.

func (*Manager) SetActive

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

SetActive sets a new active pool manager element.

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)
	GetDiskState() (*resources.Disk, 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