operations

package
v0.0.0-...-1b842a1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CopyBufferSize is the size of the copy buffer for disk
	// write operations
	CopyBufferSize = 5 * 1024 * 1024
)

Variables

This section is empty.

Functions

func LogFaultErrors

func LogFaultErrors(ctx context.Context, fe *fault.Errors, prefix string)

LogFaultErrors is a helper function that logs all entries in the Errors struct.

Types

type BackupOperation

type BackupOperation struct {
	ResourceOwner idname.Provider

	Results   BackupResults      `json:"results"`
	Selectors selectors.Selector `json:"selectors"`
	Version   string             `json:"version"`

	// BackupVersion ONLY controls the value that gets persisted to the
	// backup model after operation.  It does NOT modify the operation behavior
	// to match the version.  Its inclusion here is, unfortunately, purely to
	// facilitate integration testing that requires a certain backup version, and
	// should be removed when we have a more controlled workaround.
	BackupVersion int
	// contains filtered or unexported fields
}

BackupOperation wraps an operation with backup-specific props.

func NewBackupOperation

func NewBackupOperation(
	ctx context.Context,
	opts control.Options,
	kw *kopia.Wrapper,
	sw store.BackupStorer,
	bp inject.BackupProducer,
	acct account.Account,
	selector selectors.Selector,
	owner idname.Provider,
	bus events.Eventer,
	counter *count.Bus,
) (BackupOperation, error)

NewBackupOperation constructs and validates a backup operation.

func (*BackupOperation) Run

func (op *BackupOperation) Run(ctx context.Context) (err error)

Run begins a synchronous backup operation.

type BackupResults

type BackupResults struct {
	stats.ReadWrites
	stats.StartAndEndTime
	BackupID model.StableID `json:"backupID"`
	// keys are found in /pkg/count/keys.go
	Counts map[string]int64 `json:"counts"`
}

BackupResults aggregate the details of the result of the operation.

type ExportOperation

type ExportOperation struct {
	BackupID  model.StableID
	Results   RestoreResults
	Selectors selectors.Selector
	ExportCfg control.ExportConfig
	Version   string
	// contains filtered or unexported fields
}

ExportOperation wraps an operation with export-specific props.

func NewExportOperation

NewExportOperation constructs and validates a export operation.

func (*ExportOperation) GetStats

func (op *ExportOperation) GetStats() map[path.CategoryType]metrics.KindStats

GetStats returns the stats of the export operation. You should only be calling this once the export collections have been read and process as the data that will be available here will be the data that was read and processed.

func (*ExportOperation) Run

func (op *ExportOperation) Run(ctx context.Context) (
	expColl []export.Collectioner,
	err error,
)

Run begins a synchronous export operation.

type MaintenanceOperation

type MaintenanceOperation struct {
	Results MaintenanceResults
	// contains filtered or unexported fields
}

MaintenanceOperation wraps an operation with restore-specific props.

func NewMaintenanceOperation

func NewMaintenanceOperation(
	ctx context.Context,
	opts control.Options,
	kw *kopia.Wrapper,
	storer store.BackupStorer,
	mOpts repository.Maintenance,
	bus events.Eventer,
) (MaintenanceOperation, error)

NewMaintenanceOperation constructs and validates a maintenance operation.

func (*MaintenanceOperation) Run

func (op *MaintenanceOperation) Run(ctx context.Context) (err error)

type MaintenanceResults

type MaintenanceResults struct {
	stats.StartAndEndTime
}

MaintenanceResults aggregate the details of the results of the operation.

type OpStatus

type OpStatus int

OpStatus describes the current status of an operation. InProgress - the standard value for any process that has not arrived at an end state. The end states are Failed, Completed, or NoData.

Failed - the operation was unable to begin processing data at all. No items have been written by the consumer.

Completed - the operation was able to process one or more of the items in the request. Both partial success (0 < N < len(items) errored) and total success (0 errors) are set as Completed.

NoData - only occurs when no data was involved in an operation. For example, if a backup is requested for a specific user's mail, but that account contains zero mail messages, the backup contains No Data.

const (
	Unknown    OpStatus = 0 // Status Unknown
	InProgress OpStatus = 1 // In Progress
	Completed  OpStatus = 2 // Completed
	Failed     OpStatus = 3 // Failed
	NoData     OpStatus = 4 // No Data
)

func (OpStatus) String

func (i OpStatus) String() string

type PersistentConfigOperation

type PersistentConfigOperation struct {
	Results PersistentConfigResults
	// contains filtered or unexported fields
}

PersistentConfig wraps an operation that deals with repo configuration.

func NewPersistentConfigOperation

func NewPersistentConfigOperation(
	ctx context.Context,
	opts control.Options,
	kw *kopia.Wrapper,
	configOpts repository.PersistentConfig,
	bus events.Eventer,
) (PersistentConfigOperation, error)

NewPersistentConfigOperation constructs and validates an operation to change various persistent config parameters like the minimum epoch duration for the kopia index.

func (*PersistentConfigOperation) Run

func (op *PersistentConfigOperation) Run(ctx context.Context) (err error)

type PersistentConfigResults

type PersistentConfigResults struct {
	stats.StartAndEndTime
}

PersistentConfigResults aggregate the details of the results of the operation.

type RestoreOperation

type RestoreOperation struct {
	BackupID   model.StableID
	Results    RestoreResults
	Selectors  selectors.Selector
	RestoreCfg control.RestoreConfig
	Version    string
	// contains filtered or unexported fields
}

RestoreOperation wraps an operation with restore-specific props.

func NewRestoreOperation

func NewRestoreOperation(
	ctx context.Context,
	opts control.Options,
	kw *kopia.Wrapper,
	sw store.BackupStorer,
	rc inject.RestoreConsumer,
	acct account.Account,
	backupID model.StableID,
	sel selectors.Selector,
	restoreCfg control.RestoreConfig,
	bus events.Eventer,
	ctr *count.Bus,
) (RestoreOperation, error)

NewRestoreOperation constructs and validates a restore operation.

func (*RestoreOperation) Run

func (op *RestoreOperation) Run(ctx context.Context) (restoreDetails *details.Details, err error)

Run begins a synchronous restore operation.

type RestoreResults

type RestoreResults struct {
	stats.ReadWrites
	stats.StartAndEndTime
}

RestoreResults aggregate the details of the results of the operation.

type RetentionConfigOperation

type RetentionConfigOperation struct {
	Results RetentionConfigResults
	// contains filtered or unexported fields
}

RetentionConfigOperation wraps an operation with restore-specific props.

func NewRetentionConfigOperation

func NewRetentionConfigOperation(
	ctx context.Context,
	opts control.Options,
	kw *kopia.Wrapper,
	rcOpts repository.Retention,
	bus events.Eventer,
) (RetentionConfigOperation, error)

NewRetentionConfigOperation constructs and validates an operation to change retention parameters.

func (*RetentionConfigOperation) Run

func (op *RetentionConfigOperation) Run(ctx context.Context) (err error)

type RetentionConfigResults

type RetentionConfigResults struct {
	stats.StartAndEndTime
}

RetentionConfigResults aggregate the details of the results of the operation.

Directories

Path Synopsis
test

Jump to

Keyboard shortcuts

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