dataoperation

package
v1.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// OperationLabel is used for pod anti affinity.
	OperationLabel = "fluid.io/operation"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OperationInterface

type OperationInterface interface {
	// HasPrecedingOperation check if current data operation depends on another data operation
	HasPrecedingOperation() bool

	// GetOperationObject get the data operation object
	GetOperationObject() client.Object

	// GetTargetDataset get the target dataset of the data operation, implementor should return the newest target dataset.
	GetTargetDataset() (*datav1alpha1.Dataset, error)

	// GetReleaseNameSpacedName get the installed helm chart name
	GetReleaseNameSpacedName() types.NamespacedName

	// GetChartsDirectory get the helm charts directory of data operation
	GetChartsDirectory() string

	// GetOperationType get the data operation type
	GetOperationType() OperationType

	// UpdateOperationApiStatus update the data operation status, object is the data operation crd instance.
	UpdateOperationApiStatus(opStatus *datav1alpha1.OperationStatus) error

	// Validate check the data operation spec is valid or not, if not valid return error with conditions
	Validate(ctx runtime.ReconcileRequestContext) ([]datav1alpha1.Condition, error)

	// UpdateStatusInfoForCompleted update the status infos field for phase completed, the parameter infos is not nil
	UpdateStatusInfoForCompleted(infos map[string]string) error

	// SetTargetDatasetStatusInProgress set the dataset status for certain field when data operation executing.
	SetTargetDatasetStatusInProgress(dataset *datav1alpha1.Dataset)

	// RemoveTargetDatasetStatusInProgress remove the dataset status for certain field when data operation finished.
	RemoveTargetDatasetStatusInProgress(dataset *datav1alpha1.Dataset)

	GetStatusHandler() StatusHandler

	// GetTTL gets timeToLive
	GetTTL() (ttl *int32, err error)

	// GetParallelTaskNumber get the parallel tasks for data operations.
	GetParallelTaskNumber() int32
}

OperationInterface the interface of data operation crd

func BuildMockDataloadOperationReconcilerInterface added in v1.0.0

func BuildMockDataloadOperationReconcilerInterface(expectType OperationType, ttlSecondsAfterFinished *int32) (operation OperationInterface)

type OperationInterfaceBuilder added in v1.0.0

type OperationInterfaceBuilder interface {
	Build(object client.Object) (OperationInterface, error)
}

type OperationType

type OperationType string
const (
	DataLoadType    OperationType = "DataLoad"
	DataBackupType  OperationType = "DataBackup"
	DataMigrateType OperationType = "DataMigrate"
	DataProcessType OperationType = "DataProcess"
)

type ReconcileRequestContext

type ReconcileRequestContext struct {
	// used for create engine
	cruntime.ReconcileRequestContext

	// object for dataset operation
	DataObject          client.Object
	OpStatus            *v1alpha1.OperationStatus
	DataOpFinalizerName string
}

ReconcileRequestContext loads or applys the configuration state of a service.

type StatusHandler added in v1.0.0

type StatusHandler interface {
	// GetOperationStatus get operation status according to helm chart status
	GetOperationStatus(ctx runtime.ReconcileRequestContext, opStatus *datav1alpha1.OperationStatus) (result *datav1alpha1.OperationStatus, err error)
}

Jump to

Keyboard shortcuts

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