Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultDownloaderOptions(downloader *DownloadModular, cfg *gfspconfig.GfSpConfig) error
- func ErrConsensusWithDetail(detail string) *gfsperrors.GfSpError
- func ErrGfSpDBWithDetail(detail string) *gfsperrors.GfSpError
- func ErrPieceStoreWithDetail(detail string) *gfsperrors.GfSpError
- func NewDownloadModular(app *gfspapp.GfSpBaseApp, cfg *gfspconfig.GfSpConfig) (coremodule.Modular, error)
- type DownloadModular
- func (d *DownloadModular) HandleChallengePiece(ctx context.Context, challengePieceTask 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(context.Context, task.ChallengePieceTask)
- func (d *DownloadModular) PostDownloadObject(context.Context, task.DownloadObjectTask)
- func (d *DownloadModular) PostDownloadPiece(context.Context, task.DownloadPieceTask)
- func (d *DownloadModular) PreChallengePiece(ctx context.Context, challengePieceTask 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(context.Context, 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") ErrKeyFormat = gfsperrors.Register(module.DownloadModularName, http.StatusBadRequest, 30007, "invalid key format") ErrAccountFrozen = gfsperrors.Register(module.DownloadModularName, http.StatusNotAcceptable, 30008, "stream account has been frozen") ErrDownloadStatus = gfsperrors.Register(module.DownloadModularName, http.StatusBadRequest, 30009, "object cannot be downloaded") )
Functions ¶
func DefaultDownloaderOptions ¶
func DefaultDownloaderOptions(downloader *DownloadModular, cfg *gfspconfig.GfSpConfig) error
func ErrConsensusWithDetail ¶ added in v0.2.4
func ErrConsensusWithDetail(detail string) *gfsperrors.GfSpError
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 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, challengePieceTask 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(context.Context, task.ChallengePieceTask)
func (*DownloadModular) PostDownloadObject ¶
func (d *DownloadModular) PostDownloadObject(context.Context, task.DownloadObjectTask)
func (*DownloadModular) PostDownloadPiece ¶
func (d *DownloadModular) PostDownloadPiece(context.Context, task.DownloadPieceTask)
func (*DownloadModular) PreChallengePiece ¶
func (d *DownloadModular) PreChallengePiece(ctx context.Context, challengePieceTask 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.