receiver

package
v0.2.3-alpha.11 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultReceivePieceParallelPerNode defines the default max receive piece parallel
	// per receiver
	DefaultReceivePieceParallelPerNode = 10240
)

Variables

View Source
var (
	ErrDanglingTask        = gfsperrors.Register(module.ReceiveModularName, http.StatusBadRequest, 80001, "OoooH... request lost, try again later")
	ErrRepeatedTask        = gfsperrors.Register(module.ReceiveModularName, http.StatusNotAcceptable, 80002, "request repeated")
	ErrUnfinishedTask      = gfsperrors.Register(module.ReceiveModularName, http.StatusForbidden, 80003, "replicate piece unfinished")
	ErrInvalidDataChecksum = gfsperrors.Register(module.ReceiveModularName, http.StatusNotAcceptable, 80004, "verify data checksum failed")
	ErrPieceStore          = gfsperrors.Register(module.ReceiveModularName, http.StatusInternalServerError, 85101, "server slipped away, try again later")
	ErrGfSpDB              = gfsperrors.Register(module.ReceiveModularName, http.StatusInternalServerError, 85201, "server slipped away, try again later")
)

Functions

func DefaultReceiverOptions

func DefaultReceiverOptions(receiver *ReceiveModular, cfg *gfspconfig.GfSpConfig) error

func NewReceiveModular

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

Types

type ReceiveModular

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

func (*ReceiveModular) HandleDoneReceivePieceTask

func (r *ReceiveModular) HandleDoneReceivePieceTask(ctx context.Context, task task.ReceivePieceTask) ([]byte, error)

func (*ReceiveModular) HandleReceivePieceTask

func (r *ReceiveModular) HandleReceivePieceTask(ctx context.Context, task task.ReceivePieceTask, data []byte) error

func (*ReceiveModular) Name

func (r *ReceiveModular) Name() string

func (*ReceiveModular) QueryTasks

func (r *ReceiveModular) QueryTasks(ctx context.Context, subKey task.TKey) ([]task.Task, error)

func (*ReceiveModular) ReleaseResource

func (r *ReceiveModular) ReleaseResource(ctx context.Context, span rcmgr.ResourceScopeSpan)

func (*ReceiveModular) ReserveResource

func (r *ReceiveModular) ReserveResource(ctx context.Context, state *rcmgr.ScopeStat) (rcmgr.ResourceScopeSpan, error)

func (*ReceiveModular) Start

func (r *ReceiveModular) Start(ctx context.Context) error

func (*ReceiveModular) Stop

func (r *ReceiveModular) Stop(ctx context.Context) error

Jump to

Keyboard shortcuts

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