receiver

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 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")
)

Functions

func DefaultReceiverOptions

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

func ErrGfSpDBWithDetail added in v0.2.4

func ErrGfSpDBWithDetail(detail string) *gfsperrors.GfSpError

func ErrPieceStoreWithDetail added in v0.2.4

func ErrPieceStoreWithDetail(detail string) *gfsperrors.GfSpError

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