Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultReceiverOptions(receiver *ReceiveModular, cfg *gfspconfig.GfSpConfig) error
- func NewReceiveModular(app *gfspapp.GfSpBaseApp, cfg *gfspconfig.GfSpConfig) (coremodule.Modular, error)
- type ReceiveModular
- func (r *ReceiveModular) HandleDoneReceivePieceTask(ctx context.Context, task task.ReceivePieceTask) ([]byte, error)
- func (r *ReceiveModular) HandleReceivePieceTask(ctx context.Context, task task.ReceivePieceTask, data []byte) error
- func (r *ReceiveModular) Name() string
- func (r *ReceiveModular) QueryTasks(ctx context.Context, subKey task.TKey) ([]task.Task, error)
- func (r *ReceiveModular) ReleaseResource(ctx context.Context, span rcmgr.ResourceScopeSpan)
- func (r *ReceiveModular) ReserveResource(ctx context.Context, state *rcmgr.ScopeStat) (rcmgr.ResourceScopeSpan, error)
- func (r *ReceiveModular) Start(ctx context.Context) error
- func (r *ReceiveModular) Stop(ctx context.Context) error
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 (*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)
Click to show internal directories.
Click to hide internal directories.