executor

package
v0.2.3-test.3 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultExecutorMaxExecuteNum defines the default max parallel execute task number.
	DefaultExecutorMaxExecuteNum int64 = 5120
	// DefaultExecutorAskTaskInterval defines the default ask task interval from manager.
	DefaultExecutorAskTaskInterval int = 1
	// DefaultExecutorAskReplicateApprovalTimeout defines the ask replicate piece approval
	// timeout that send the request to the p2p node,
	DefaultExecutorAskReplicateApprovalTimeout int64 = 4
	// DefaultExecutorAskReplicateApprovalExFactor defines the expanded factor for asking
	// secondary SP.
	// Example: need data chunk + data parity chunk numbers SPs as secondary, consider fault
	// 	tolerance, should collect (data chunk + data parity chunk) * factor numbers SPs as
	//	backup secondary, if some of these are failed to replicate can pick up again from
	//  backups. So it is always bigger than 1.0.
	DefaultExecutorAskReplicateApprovalExFactor float64 = 1.0
	// DefaultExecutorListenSealTimeoutHeight defines the default listen seal object on
	// greenfield timeout height, if after current block height + timeout height, the object
	// is not sealed, it is judged failed to seal object on greenfield.
	DefaultExecutorListenSealTimeoutHeight int = 10
	// DefaultExecutorListenSealRetryTimeout defines the sleep time when listen seal object
	// fail, until retry ExecutorMaxListenSealRetry times, the task is set error.
	DefaultExecutorListenSealRetryTimeout int = 2
	// DefaultExecutorMaxListenSealRetry defines the default max retry number for listening
	// object.
	DefaultExecutorMaxListenSealRetry int = 3
	// DefaultStatisticsOutputInterval defines the default interval for output statistics info,
	// it is used to log and debug.
	DefaultStatisticsOutputInterval int = 60
	// DefaultSleepInterval defines the sleep interval when failed to ask task
	// it is millisecond level
	DefaultSleepInterval = 100
)
View Source
const (
	ExeutorSuccessAskTask   = "executor_ask_task_success"
	ExeutorFailureAskTask   = "executor_ask_task_failure"
	ExeutorFailureAskNoTask = "executor_ask_no_task_failure"

	ExeutorSuccessReplicateTask  = "executor_replicate_task_success"
	ExeutorFailureReplicateTask  = "executor_replicate_task_failure"
	ExeutorSuccessSealObjectTask = "executor_seal_object_task_success"
	ExeutorFailureSealObjectTask = "executor_seal_object_task_failure"
	ExeutorSuccessReceiveTask    = "executor_receive_task_success"
	ExeutorFailureReceiveTask    = "executor_receive_task_failure"
	ExeutorSuccessRecoveryTask   = "executor_recovery_task_success"
	ExeutorFailureRecoveryTask   = "executor_recovery_task_failure"

	ExeutorSuccessReportTask = "executor_report_task_to_manager_success"
	ExeutorFailureReportTask = "executor_report_task_to_manager_failure"

	ExeutorSuccessP2P                = "executor_p2p_success"
	ExeutorFailureP2P                = "executor_p2p_failure"
	ExeutorSuccessReplicateAllPiece  = "executor_replicate_all_piece_success"
	ExeutorFailureReplicateAllPiece  = "executor_replicate_all_piece_failure"
	ExeutorSuccessReplicateOnePiece  = "executor_replicate_one_piece_success"
	ExeutorFailureReplicateOnePiece  = "executor_replicate_one_piece_failure"
	ExeutorSuccessDoneReplicatePiece = "executor_done_replicate_piece_success"
	ExeutorFailureDoneReplicatePiece = "executor_done_replicate_piece_failure"
	ExeutorSuccessSealObject         = "executor_seal_object_success"
	ExeutorFailureSealObject         = "executor_seal_object_failure"
)

Variables

View Source
var (
	ErrDanglingPointer         = gfsperrors.Register(module.ExecuteModularName, http.StatusBadRequest, 40001, "OoooH.... request lost")
	ErrInsufficientApproval    = gfsperrors.Register(module.ExecuteModularName, http.StatusNotFound, 40002, "insufficient approvals from p2p")
	ErrUnsealed                = gfsperrors.Register(module.ExecuteModularName, http.StatusInternalServerError, 40003, "seal object on chain failed")
	ErrExhaustedApproval       = gfsperrors.Register(module.ExecuteModularName, http.StatusNotFound, 40004, "approvals exhausted")
	ErrInvalidIntegrity        = gfsperrors.Register(module.ExecuteModularName, http.StatusNotAcceptable, 40005, "secondary integrity hash verification failed")
	ErrSecondaryMismatch       = gfsperrors.Register(module.ExecuteModularName, http.StatusNotAcceptable, 40006, "secondary sp mismatch")
	ErrReplicateIdsOutOfBounds = gfsperrors.Register(module.ExecuteModularName, http.StatusNotAcceptable, 40007, "replicate idx out of bounds")
	ErrGfSpDB                  = gfsperrors.Register(module.ExecuteModularName, http.StatusInternalServerError, 45201, "server slipped away, try again later")
	ErrRecoveryRedundancyType  = gfsperrors.Register(module.ExecuteModularName, http.StatusInternalServerError, 45202, "recovery only support EC redundancy type")
	ErrRecoveryPieceNotEnough  = gfsperrors.Register(module.ExecuteModularName, http.StatusInternalServerError, 45203, "fail to get enough piece data to recovery")
	ErrRecoveryDecode          = gfsperrors.Register(module.ExecuteModularName, http.StatusInternalServerError, 45204, "EC decode error")
	ErrPieceStore              = gfsperrors.Register(module.ReceiveModularName, http.StatusInternalServerError, 45205, "server slipped away, try again later")
	ErrRecoveryPieceChecksum   = gfsperrors.Register(module.ExecuteModularName, http.StatusInternalServerError, 45206, "recovery checksum not correct")
	ErrRecoveryPieceLength     = gfsperrors.Register(module.ExecuteModularName, http.StatusInternalServerError, 45207, "get secondary piece data length error")
	ErrPrimaryNotFound         = gfsperrors.Register(module.ExecuteModularName, http.StatusNotAcceptable, 45208, "primary sp endpoint not found when recoverying")
	ErrRecoveryPieceIndex      = gfsperrors.Register(module.ExecuteModularName, http.StatusNotAcceptable, 45209, "recovery piece index invalid")
)

Functions

func DefaultExecutorOptions

func DefaultExecutorOptions(executor *ExecuteModular, cfg *gfspconfig.GfSpConfig) error

func NewExecuteModular

func NewExecuteModular(app *gfspapp.GfSpBaseApp, cfg *gfspconfig.GfSpConfig) (coremodule.Modular, error)

Types

type ExecuteModular

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

func (*ExecuteModular) AskReplicatePieceApproval

func (e *ExecuteModular) AskReplicatePieceApproval(ctx context.Context, task coretask.ApprovalReplicatePieceTask,
	low, high int, timeout int64) (
	[]*gfsptask.GfSpReplicatePieceApprovalTask, error)

func (*ExecuteModular) AskTask

func (e *ExecuteModular) AskTask(ctx context.Context) error

func (*ExecuteModular) HandleGCMetaTask

func (e *ExecuteModular) HandleGCMetaTask(ctx context.Context, task coretask.GCMetaTask)

func (*ExecuteModular) HandleGCObjectTask

func (e *ExecuteModular) HandleGCObjectTask(ctx context.Context, task coretask.GCObjectTask)

func (*ExecuteModular) HandleGCZombiePieceTask

func (e *ExecuteModular) HandleGCZombiePieceTask(ctx context.Context, task coretask.GCZombiePieceTask)

func (*ExecuteModular) HandleReceivePieceTask

func (e *ExecuteModular) HandleReceivePieceTask(ctx context.Context, task coretask.ReceivePieceTask)

func (*ExecuteModular) HandleRecoverPieceTask added in v0.2.3

func (e *ExecuteModular) HandleRecoverPieceTask(ctx context.Context, task coretask.RecoveryPieceTask)

HandleRecoverPieceTask handle the recovery piece task, it will send request to other SPs to get piece data to recovery, recovery the original data, and write the recovered data to piece store

func (*ExecuteModular) HandleReplicatePieceTask

func (e *ExecuteModular) HandleReplicatePieceTask(ctx context.Context, task coretask.ReplicatePieceTask)

func (*ExecuteModular) HandleSealObjectTask

func (e *ExecuteModular) HandleSealObjectTask(ctx context.Context, task coretask.SealObjectTask)

func (*ExecuteModular) Name

func (e *ExecuteModular) Name() string

func (*ExecuteModular) ReleaseResource

func (e *ExecuteModular) ReleaseResource(
	ctx context.Context,
	span corercmgr.ResourceScopeSpan)

func (*ExecuteModular) ReportTask

func (e *ExecuteModular) ReportTask(
	ctx context.Context,
	task coretask.Task) (err error)

func (*ExecuteModular) ReserveResource

func (*ExecuteModular) Start

func (e *ExecuteModular) Start(ctx context.Context) error

func (*ExecuteModular) Statistics

func (e *ExecuteModular) Statistics() string

func (*ExecuteModular) Stop

func (e *ExecuteModular) Stop(ctx context.Context) error

Jump to

Keyboard shortcuts

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