receiver

package
v0.2.1-test-2 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	ErrDanglingTask        = gfsperrors.Register(module.ReceiveModularName, http.StatusInternalServerError, 80001, "OoooH... request lost, try again later")
	ErrRepeatedTask        = gfsperrors.Register(module.ReceiveModularName, http.StatusBadRequest, 80002, "request repeated")
	ErrExceedTask          = gfsperrors.Register(module.ReceiveModularName, http.StatusServiceUnavailable, 80003, "OoooH... request exceed, try again later")
	ErrUnfinishedTask      = gfsperrors.Register(module.ReceiveModularName, http.StatusForbidden, 80004, "replicate piece unfinished")
	ErrInvalidDataChecksum = gfsperrors.Register(module.ReceiveModularName, http.StatusNotAcceptable, 80005, "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, []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