Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EncodedReader ¶
type EncodedReader struct {
// contains filtered or unexported fields
}
EncodedReader provides a redundant piece for given reader.
func NewEncodedReader ¶
func NewEncodedReader(r io.Reader, rs eestream.RedundancyStrategy, num int) *EncodedReader
NewEncodedReader provides a reader that returns a redundant piece for the reader using the given redundancy strategy and piece number.
type Scheduler ¶
Scheduler is used to coordinate and constrain resources between concurrent segment uploads.
type Upload ¶
type Upload struct {
// contains filtered or unexported fields
}
Upload is a segment upload that has been started and returned by the Begin method.
func Begin ¶
func Begin(ctx context.Context, beginSegment *metaclient.BeginSegmentResponse, segment splitter.Segment, limitsExchanger pieceupload.LimitsExchanger, piecePutter pieceupload.PiecePutter, scheduler Scheduler, longTailMargin int, ) (_ *Upload, err error)
Begin starts a segment upload identified by the segment ID provided in the beginSegment response. The returned upload will complete when enough piece uploads to fulfill the optimal threshold for the segment redundancy strategy plus a small long tail margin. It cancels remaining piece uploads once that threshold has been hit.
func (*Upload) Wait ¶
func (upload *Upload) Wait() (_ *metaclient.CommitSegmentParams, err error)
Wait blocks until the segment upload completes. It will be successful as long as enough pieces have uploaded successfully.