datapath

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TaskTypeBackup  = "backup"
	TaskTypeRestore = "restore"

	ErrCancelled = "data path is canceled"

	EventReasonStarted    = "Data-Path-Started"
	EventReasonCompleted  = "Data-Path-Completed"
	EventReasonFailed     = "Data-Path-Failed"
	EventReasonCancelled  = "Data-Path-Canceled"
	EventReasonProgress   = "Data-Path-Progress"
	EventReasonCancelling = "Data-Path-Canceling"
	EventReasonStopped    = "Data-Path-Stopped"
)

Variables

View Source
var ConcurrentLimitExceed error = errors.New("Concurrent number exceeds")
View Source
var FSBRCreator = newFileSystemBR
View Source
var MicroServiceBRWatcherCreator = newMicroServiceBRWatcher

Functions

This section is empty.

Types

type AccessPoint

type AccessPoint struct {
	ByPath  string                        `json:"byPath"`
	VolMode uploader.PersistentVolumeMode `json:"volumeMode"`
}

AccessPoint represents an access point that has been exposed to a data path instance

type AsyncBR

type AsyncBR interface {
	// Init initializes an asynchronous data path instance
	Init(ctx context.Context, param interface{}) error

	// StartBackup starts an asynchronous data path instance for backup
	StartBackup(source AccessPoint, dataMoverConfig map[string]string, param interface{}) error

	// StartRestore starts an asynchronous data path instance for restore
	StartRestore(snapshotID string, target AccessPoint, dataMoverConfig map[string]string) error

	// Cancel cancels an asynchronous data path instance
	Cancel()

	// Close closes an asynchronous data path instance
	Close(ctx context.Context)
}

AsyncBR is the interface for asynchronous data path methods

type BackupResult

type BackupResult struct {
	SnapshotID    string      `json:"snapshotID"`
	EmptySnapshot bool        `json:"emptySnapshot"`
	Source        AccessPoint `json:"source,omitempty"`
}

BackupResult represents the result of a backup

type Callbacks

type Callbacks struct {
	OnCompleted func(context.Context, string, string, Result)
	OnFailed    func(context.Context, string, string, error)
	OnCancelled func(context.Context, string, string)
	OnProgress  func(context.Context, string, string, *uploader.Progress)
}

Callbacks defines the collection of callbacks during backup/restore

type DataPathError added in v1.14.0

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

DataPathError represents an error that occurred during a backup or restore operation

func (DataPathError) Error added in v1.14.0

func (e DataPathError) Error() string

Error implements error.

func (DataPathError) GetSnapshotID added in v1.14.0

func (e DataPathError) GetSnapshotID() string

GetSnapshotID returns the snapshot ID for the error.

type FSBRInitParam added in v1.15.0

type FSBRInitParam struct {
	BSLName           string
	SourceNamespace   string
	UploaderType      string
	RepositoryType    string
	RepoIdentifier    string
	RepositoryEnsurer *repository.Ensurer
	CredentialGetter  *credentials.CredentialGetter
	Filesystem        filesystem.Interface
}

FSBRInitParam define the input param for FSBR init

type FSBRStartParam added in v1.15.0

type FSBRStartParam struct {
	RealSource     string
	ParentSnapshot string
	ForceFull      bool
	Tags           map[string]string
}

FSBRStartParam define the input param for FSBR start

type Manager

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

func NewManager

func NewManager(cocurrentNum int) *Manager

NewManager creates the data path manager to manage concurrent data path instances

func (*Manager) CreateFileSystemBR

func (m *Manager) CreateFileSystemBR(jobName string, requestorType string, ctx context.Context, client client.Client, namespace string, callbacks Callbacks, log logrus.FieldLogger) (AsyncBR, error)

CreateFileSystemBR creates a new file system backup/restore data path instance

func (*Manager) CreateMicroServiceBRWatcher added in v1.15.0

func (m *Manager) CreateMicroServiceBRWatcher(ctx context.Context, client client.Client, kubeClient kubernetes.Interface, mgr manager.Manager, taskType string,
	taskName string, namespace string, podName string, containerName string, associatedObject string, callbacks Callbacks, resume bool, log logrus.FieldLogger) (AsyncBR, error)

CreateMicroServiceBRWatcher creates a new micro service watcher instance

func (*Manager) GetAsyncBR

func (m *Manager) GetAsyncBR(jobName string) AsyncBR

GetAsyncBR returns the file system backup/restore data path instance for the specified job name

func (*Manager) RemoveAsyncBR

func (m *Manager) RemoveAsyncBR(jobName string)

RemoveAsyncBR removes a file system backup/restore data path instance

type RestoreResult

type RestoreResult struct {
	Target AccessPoint `json:"target,omitempty"`
}

RestoreResult represents the result of a restore

type Result

type Result struct {
	Backup  BackupResult
	Restore RestoreResult
}

Result represents the result of a backup/restore

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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