process

package
v0.0.0-...-f7d1ac2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeprovisionOperationManager

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

func NewDeprovisionOperationManager

func NewDeprovisionOperationManager(storage storage.Operations) *DeprovisionOperationManager

func (*DeprovisionOperationManager) InsertOperation

InsertOperation stores operation in database

func (*DeprovisionOperationManager) OperationFailed

OperationFailed marks the operation as failed and only repeats it if there is a storage error

func (*DeprovisionOperationManager) OperationSucceeded

OperationSucceeded marks the operation as succeeded and only repeats it if there is a storage error

func (*DeprovisionOperationManager) RetryOperation

func (om *DeprovisionOperationManager) RetryOperation(operation internal.DeprovisioningOperation, errorMessage string, err error, retryInterval time.Duration, maxTime time.Duration, log logrus.FieldLogger) (internal.DeprovisioningOperation, time.Duration, error)

RetryOperation retries an operation for at maxTime in retryInterval steps and fails the operation if retrying failed

func (*DeprovisionOperationManager) RetryOperationOnce

RetryOperationOnce retries the operation once and fails the operation when call second time

func (*DeprovisionOperationManager) RetryOperationWithoutFail

func (om *DeprovisionOperationManager) RetryOperationWithoutFail(operation internal.DeprovisioningOperation, description string, retryInterval, maxTime time.Duration, log logrus.FieldLogger) (internal.DeprovisioningOperation, time.Duration, error)

RetryOperationWithoutFail retries an operation for at maxTime in retryInterval steps and omits the operation if retrying failed

func (*DeprovisionOperationManager) UpdateOperation

UpdateOperation updates a given operation and handles conflict situation

type DeprovisioningStepProcessed

type DeprovisioningStepProcessed struct {
	StepProcessed
	OldOperation internal.DeprovisioningOperation
	Operation    internal.DeprovisioningOperation
}

type Executor

type Executor interface {
	Execute(operationID string) (time.Duration, error)
}

type OperationManager

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

func NewOperationManager

func NewOperationManager(storage storage.Operations) *OperationManager

func (*OperationManager) MarkStepAsExcutedButNotCompleted

func (om *OperationManager) MarkStepAsExcutedButNotCompleted(operation internal.Operation, stepName string, msg string, log logrus.FieldLogger) (internal.Operation, time.Duration, error)

func (*OperationManager) OperationCanceled

func (om *OperationManager) OperationCanceled(operation internal.Operation, description string, log logrus.FieldLogger) (internal.Operation, time.Duration, error)

OperationCanceled marks the operation as canceled and returns status of the operation's update

func (*OperationManager) OperationFailed

func (om *OperationManager) OperationFailed(operation internal.Operation, description string, err error, log logrus.FieldLogger) (internal.Operation, time.Duration, error)

OperationFailed marks the operation as failed and returns status of the operation's update

func (*OperationManager) OperationSucceeded

func (om *OperationManager) OperationSucceeded(operation internal.Operation, description string, log logrus.FieldLogger) (internal.Operation, time.Duration, error)

OperationSucceeded marks the operation as succeeded and returns status of the operation's update

func (*OperationManager) RetryOperation

func (om *OperationManager) RetryOperation(operation internal.Operation, errorMessage string, err error, retryInterval time.Duration, maxTime time.Duration, log logrus.FieldLogger) (internal.Operation, time.Duration, error)

RetryOperation checks if operation should be retried or if it's the status should be marked as failed

func (*OperationManager) RetryOperationOnce

func (om *OperationManager) RetryOperationOnce(operation internal.Operation, errorMessage string, err error, wait time.Duration, log logrus.FieldLogger) (internal.Operation, time.Duration, error)

RetryOperationOnce retries the operation once and fails the operation when call second time

func (*OperationManager) RetryOperationWithoutFail

func (om *OperationManager) RetryOperationWithoutFail(operation internal.Operation, stepName string, description string, retryInterval, maxTime time.Duration, log logrus.FieldLogger) (internal.Operation, time.Duration, error)

RetryOperationWithoutFail checks if operation should be retried or updates the status to InProgress, but omits setting the operation to failed if maxTime is reached

func (*OperationManager) UpdateOperation

func (om *OperationManager) UpdateOperation(operation internal.Operation, update func(operation *internal.Operation), log logrus.FieldLogger) (internal.Operation, time.Duration, error)

UpdateOperation updates a given operation and handles conflict situation

type OperationStepProcessed

type OperationStepProcessed struct {
	StepProcessed
	OldOperation internal.Operation
	Operation    internal.Operation
}

type OperationSucceeded

type OperationSucceeded struct {
	Operation internal.Operation
}

type ProvisionOperationManager

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

func NewProvisionOperationManager

func NewProvisionOperationManager(storage storage.Operations) *ProvisionOperationManager

func (*ProvisionOperationManager) HandleError

func (*ProvisionOperationManager) OperationFailed

OperationFailed marks the operation as failed and only repeats it if there is a storage error

func (*ProvisionOperationManager) OperationSucceeded

OperationSucceeded marks the operation as succeeded and only repeats it if there is a storage error

func (*ProvisionOperationManager) RetryOperation

func (om *ProvisionOperationManager) RetryOperation(operation internal.ProvisioningOperation, errorMessage string, err error, retryInterval time.Duration, maxTime time.Duration, log logrus.FieldLogger) (internal.ProvisioningOperation, time.Duration, error)

RetryOperation retries an operation for at maxTime in retryInterval steps and fails the operation if retrying failed

func (*ProvisionOperationManager) RetryOperationOnce

RetryOperationOnce retries the operation once and fails the operation when call second time

func (*ProvisionOperationManager) SimpleUpdateOperation deprecated

Deprecated: SimpleUpdateOperation updates a given operation without handling conflicts. Should be used when operation's data mutations are not clear

func (*ProvisionOperationManager) UpdateOperation

UpdateOperation updates a given operation and handles conflict situation

type ProvisioningStepProcessed

type ProvisioningStepProcessed struct {
	StepProcessed
	Operation internal.ProvisioningOperation
}

type ProvisioningSucceeded

type ProvisioningSucceeded struct {
	Operation internal.ProvisioningOperation
}

type Queue

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

func NewQueue

func NewQueue(executor Executor, log logrus.FieldLogger) *Queue

func (*Queue) Add

func (q *Queue) Add(processId string)

func (*Queue) AddAfter

func (q *Queue) AddAfter(processId string, duration time.Duration)

func (*Queue) Run

func (q *Queue) Run(stop <-chan struct{}, workersAmount int)

func (*Queue) ShutDown

func (q *Queue) ShutDown()

func (*Queue) SpeedUp

func (q *Queue) SpeedUp(speedFactor int64)

SpeedUp changes speedFactor parameter to reduce time between processing operations. This method should only be used for testing purposes

type StagedManager

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

func NewStagedManager

func NewStagedManager(storage storage.Operations, pub event.Publisher, operationTimeout time.Duration, logger logrus.FieldLogger) *StagedManager

func (*StagedManager) AddStep

func (m *StagedManager) AddStep(stageName string, step Step, cnd StepCondition) error

func (*StagedManager) DefineStages

func (m *StagedManager) DefineStages(names []string)

func (*StagedManager) Execute

func (m *StagedManager) Execute(operationID string) (time.Duration, error)

func (*StagedManager) GetAllStages

func (m *StagedManager) GetAllStages() []string

func (*StagedManager) SpeedUp

func (m *StagedManager) SpeedUp(speedFactor int64)

SpeedUp changes speedFactor parameter to reduce the sleep time if a step needs a retry. This method should only be used for testing purposes

type Step

type Step interface {
	Name() string
	Run(operation internal.Operation, logger logrus.FieldLogger) (internal.Operation, time.Duration, error)
}

type StepCondition

type StepCondition func(operation internal.Operation) bool

type StepProcessed

type StepProcessed struct {
	StepName string
	Duration time.Duration
	When     time.Duration
	Error    error
}

type StepWithCondition

type StepWithCondition struct {
	Step
	// contains filtered or unexported fields
}

type UpdateOperationManager

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

func NewUpdateOperationManager

func NewUpdateOperationManager(storage storage.Operations) *UpdateOperationManager

func (*UpdateOperationManager) OperationFailed

func (om *UpdateOperationManager) OperationFailed(operation internal.UpdatingOperation, description string, err error, log logrus.FieldLogger) (internal.UpdatingOperation, time.Duration, error)

OperationFailed marks the operation as failed and only repeats it if there is a storage error

func (*UpdateOperationManager) OperationSucceeded

func (om *UpdateOperationManager) OperationSucceeded(operation internal.UpdatingOperation, description string, log logrus.FieldLogger) (internal.UpdatingOperation, time.Duration, error)

OperationSucceeded marks the operation as succeeded and only repeats it if there is a storage error

func (*UpdateOperationManager) RetryOperation

func (om *UpdateOperationManager) RetryOperation(operation internal.UpdatingOperation, errorMessage string, err error, retryInterval time.Duration, maxTime time.Duration, log logrus.FieldLogger) (internal.UpdatingOperation, time.Duration, error)

RetryOperation retries an operation for at maxTime in retryInterval steps and fails the operation if retrying failed

func (*UpdateOperationManager) RetryOperationWithoutFail

func (om *UpdateOperationManager) RetryOperationWithoutFail(operation internal.UpdatingOperation, description string, retryInterval, maxTime time.Duration, log logrus.FieldLogger) (internal.UpdatingOperation, time.Duration, error)

RetryOperationWithoutFail retries an operation for at maxTime in retryInterval steps and omits the operation if retrying failed

func (*UpdateOperationManager) SimpleUpdateOperation deprecated

Deprecated: SimpleUpdateOperation updates a given operation without handling conflicts. Should be used when operation's data mutations are not clear

func (*UpdateOperationManager) UpdateOperation

UpdateOperation updates a given operation

type UpdatingStepProcessed

type UpdatingStepProcessed struct {
	StepProcessed
	OldOperation internal.UpdatingOperation
	Operation    internal.UpdatingOperation
}

type UpgradeClusterOperationManager

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

func NewUpgradeClusterOperationManager

func NewUpgradeClusterOperationManager(storage storage.Operations) *UpgradeClusterOperationManager

func (*UpgradeClusterOperationManager) OperationCanceled

OperationSucceeded marks the operation as succeeded and only repeats it if there is a storage error

func (*UpgradeClusterOperationManager) OperationFailed

OperationFailed marks the operation as failed and only repeats it if there is a storage error

func (*UpgradeClusterOperationManager) OperationSucceeded

OperationSucceeded marks the operation as succeeded and only repeats it if there is a storage error

func (*UpgradeClusterOperationManager) RetryOperation

RetryOperation retries an operation for at maxTime in retryInterval steps and fails the operation if retrying failed

func (*UpgradeClusterOperationManager) RetryOperationWithoutFail

func (om *UpgradeClusterOperationManager) RetryOperationWithoutFail(operation internal.UpgradeClusterOperation, description string, retryInterval, maxTime time.Duration, log logrus.FieldLogger) (internal.UpgradeClusterOperation, time.Duration, error)

RetryOperationWithoutFail retries an operation for at maxTime in retryInterval steps and omits the operation if retrying failed

func (*UpgradeClusterOperationManager) SimpleUpdateOperation deprecated

Deprecated: SimpleUpdateOperation updates a given operation without handling conflicts. Should be used when operation's data mutations are not clear

func (*UpgradeClusterOperationManager) UpdateOperation

UpdateOperation updates a given operation

type UpgradeClusterStepProcessed

type UpgradeClusterStepProcessed struct {
	StepProcessed
	OldOperation internal.UpgradeClusterOperation
	Operation    internal.UpgradeClusterOperation
}

type UpgradeKymaOperationManager

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

func NewUpgradeKymaOperationManager

func NewUpgradeKymaOperationManager(storage storage.Operations) *UpgradeKymaOperationManager

func (*UpgradeKymaOperationManager) OperationCanceled

OperationSucceeded marks the operation as succeeded and only repeats it if there is a storage error

func (*UpgradeKymaOperationManager) OperationFailed

OperationFailed marks the operation as failed and only repeats it if there is a storage error

func (*UpgradeKymaOperationManager) OperationSucceeded

OperationSucceeded marks the operation as succeeded and only repeats it if there is a storage error

func (*UpgradeKymaOperationManager) RetryOperation

func (om *UpgradeKymaOperationManager) RetryOperation(operation internal.UpgradeKymaOperation, errorMessage string, err error, retryInterval time.Duration, maxTime time.Duration, log logrus.FieldLogger) (internal.UpgradeKymaOperation, time.Duration, error)

RetryOperation retries an operation for at maxTime in retryInterval steps and fails the operation if retrying failed

func (*UpgradeKymaOperationManager) RetryOperationWithoutFail

func (om *UpgradeKymaOperationManager) RetryOperationWithoutFail(operation internal.UpgradeKymaOperation, description string, retryInterval, maxTime time.Duration, log logrus.FieldLogger) (internal.UpgradeKymaOperation, time.Duration, error)

RetryOperationWithoutFail retries an operation for at maxTime in retryInterval steps and omits the operation if retrying failed

func (*UpgradeKymaOperationManager) SimpleUpdateOperation deprecated

Deprecated: SimpleUpdateOperation updates a given operation without handling conflicts. Should be used when operation's data mutations are not clear

func (*UpgradeKymaOperationManager) UpdateOperation

UpdateOperation updates a given operation and handles conflict situation

type UpgradeKymaStepProcessed

type UpgradeKymaStepProcessed struct {
	StepProcessed
	OldOperation internal.UpgradeKymaOperation
	Operation    internal.UpgradeKymaOperation
}

Jump to

Keyboard shortcuts

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