Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultDownloaderOptions(downloader *DownloadModular, cfg *gfspconfig.GfSpConfig) error
- func NewDownloadModular(app *gfspapp.GfSpBaseApp, cfg *gfspconfig.GfSpConfig) (coremodule.Modular, error)
- type DownloadModular
- func (d *DownloadModular) HandleChallengePiece(ctx context.Context, downloadPieceTask task.ChallengePieceTask) ([]byte, [][]byte, []byte, error)
- func (d *DownloadModular) HandleDownloadObjectTask(ctx context.Context, downloadObjectTask task.DownloadObjectTask) ([]byte, error)
- func (d *DownloadModular) HandleDownloadPieceTask(ctx context.Context, downloadPieceTask task.DownloadPieceTask) ([]byte, error)
- func (d *DownloadModular) Name() string
- func (d *DownloadModular) PostChallengePiece(ctx context.Context, downloadPieceTask task.ChallengePieceTask)
- func (d *DownloadModular) PostDownloadObject(ctx context.Context, downloadObjectTask task.DownloadObjectTask)
- func (d *DownloadModular) PostDownloadPiece(ctx context.Context, downloadPieceTask task.DownloadPieceTask)
- func (d *DownloadModular) PreChallengePiece(ctx context.Context, downloadPieceTask task.ChallengePieceTask) error
- func (d *DownloadModular) PreDownloadObject(ctx context.Context, downloadObjectTask task.DownloadObjectTask) error
- func (d *DownloadModular) PreDownloadPiece(ctx context.Context, downloadPieceTask task.DownloadPieceTask) error
- func (d *DownloadModular) QueryTasks(ctx context.Context, subKey task.TKey) ([]task.Task, error)
- func (d *DownloadModular) ReleaseResource(ctx context.Context, span rcmgr.ResourceScopeSpan)
- func (d *DownloadModular) ReserveResource(ctx context.Context, state *rcmgr.ScopeStat) (rcmgr.ResourceScopeSpan, error)
- func (d *DownloadModular) Start(ctx context.Context) error
- func (d *DownloadModular) Stop(ctx context.Context) error
- type SegmentPieceInfo
Constants ¶
View Source
const ( // DefaultDownloadObjectParallelPerNode defines the default max download object parallel // per downloader DefaultDownloadObjectParallelPerNode = 10240 // DefaultChallengePieceParallelPerNode defines the default max challenge piece parallel // per downloader DefaultChallengePieceParallelPerNode = 10240 // DefaultBucketFreeQuota defines the default free read quota per bucket DefaultBucketFreeQuota = 10 * 1024 * 1024 * 1024 )
Variables ¶
View Source
var ( ErrDanglingPointer = gfsperrors.Register(module.DownloadModularName, http.StatusBadRequest, 30001, "OoooH.... request lost") ErrObjectUnsealed = gfsperrors.Register(module.DownloadModularName, http.StatusBadRequest, 30002, "object unsealed") ErrExceedRequest = gfsperrors.Register(module.DownloadModularName, http.StatusBadRequest, 30003, "get piece request exceed") ErrExceedBucketQuota = gfsperrors.Register(module.DownloadModularName, http.StatusNotAcceptable, 30004, "bucket quota overflow") ErrInvalidParam = gfsperrors.Register(module.DownloadModularName, http.StatusBadRequest, 30005, "request params invalid") ErrNoSuchPiece = gfsperrors.Register(module.DownloadModularName, http.StatusBadRequest, 30006, "request params invalid, no such piece") ErrPieceStore = gfsperrors.Register(module.DownloadModularName, http.StatusInternalServerError, 35101, "server slipped away, try again later") ErrGfSpDB = gfsperrors.Register(module.DownloadModularName, http.StatusInternalServerError, 35201, "server slipped away, try again later") ErrKeyFormat = gfsperrors.Register(module.DownloadModularName, http.StatusBadRequest, 30007, "invalid key format") ErrConsensus = gfsperrors.Register(module.DownloadModularName, http.StatusInternalServerError, 35002, "server slipped away, try again later") )
Functions ¶
func DefaultDownloaderOptions ¶
func DefaultDownloaderOptions(downloader *DownloadModular, cfg *gfspconfig.GfSpConfig) error
func NewDownloadModular ¶
func NewDownloadModular(app *gfspapp.GfSpBaseApp, cfg *gfspconfig.GfSpConfig) (coremodule.Modular, error)
Types ¶
type DownloadModular ¶
type DownloadModular struct {
// contains filtered or unexported fields
}
func (*DownloadModular) HandleChallengePiece ¶
func (d *DownloadModular) HandleChallengePiece(ctx context.Context, downloadPieceTask task.ChallengePieceTask) ( []byte, [][]byte, []byte, error)
func (*DownloadModular) HandleDownloadObjectTask ¶
func (d *DownloadModular) HandleDownloadObjectTask(ctx context.Context, downloadObjectTask task.DownloadObjectTask) ([]byte, error)
func (*DownloadModular) HandleDownloadPieceTask ¶
func (d *DownloadModular) HandleDownloadPieceTask(ctx context.Context, downloadPieceTask task.DownloadPieceTask) ([]byte, error)
func (*DownloadModular) Name ¶
func (d *DownloadModular) Name() string
func (*DownloadModular) PostChallengePiece ¶
func (d *DownloadModular) PostChallengePiece(ctx context.Context, downloadPieceTask task.ChallengePieceTask)
func (*DownloadModular) PostDownloadObject ¶
func (d *DownloadModular) PostDownloadObject(ctx context.Context, downloadObjectTask task.DownloadObjectTask)
func (*DownloadModular) PostDownloadPiece ¶
func (d *DownloadModular) PostDownloadPiece(ctx context.Context, downloadPieceTask task.DownloadPieceTask)
func (*DownloadModular) PreChallengePiece ¶
func (d *DownloadModular) PreChallengePiece(ctx context.Context, downloadPieceTask task.ChallengePieceTask) error
func (*DownloadModular) PreDownloadObject ¶
func (d *DownloadModular) PreDownloadObject(ctx context.Context, downloadObjectTask task.DownloadObjectTask) error
func (*DownloadModular) PreDownloadPiece ¶
func (d *DownloadModular) PreDownloadPiece(ctx context.Context, downloadPieceTask task.DownloadPieceTask) error
func (*DownloadModular) QueryTasks ¶
func (*DownloadModular) ReleaseResource ¶
func (d *DownloadModular) ReleaseResource(ctx context.Context, span rcmgr.ResourceScopeSpan)
func (*DownloadModular) ReserveResource ¶
func (d *DownloadModular) ReserveResource(ctx context.Context, state *rcmgr.ScopeStat) (rcmgr.ResourceScopeSpan, error)
type SegmentPieceInfo ¶
func SplitToSegmentPieceInfos ¶
func SplitToSegmentPieceInfos(downloadObjectTask task.DownloadObjectTask, op piecestore.PieceOp) ([]*SegmentPieceInfo, error)
Click to show internal directories.
Click to hide internal directories.