MCPcopy
hub / github.com/NVIDIA/aistore / downloadRemote

Method downloadRemote

downloader/task.go:221–232  ·  view source on GitHub ↗
(lom *cluster.LOM)

Source from the content-addressed store, hash-verified

219}
220
221func (t *singleObjectTask) downloadRemote(lom *cluster.LOM) error {
222 // Set custom context values (used by `ais/backend/*`).
223 ctx, cancel := context.WithTimeout(t.downloadCtx, t.initialTimeout())
224 defer cancel()
225 wrapReader := func(r io.ReadCloser) io.ReadCloser { return t.wrapReader(ctx, r) }
226 ctx = context.WithValue(ctx, cos.CtxReadWrapper, cos.ReadWrapperFunc(wrapReader))
227 ctx = context.WithValue(ctx, cos.CtxSetSize, cos.SetSizeFunc(t.setTotalSize))
228
229 // Do final GET (prefetch) request.
230 _, err := t.parent.t.GetCold(ctx, lom, cmn.OwtGetTryLock)
231 return err
232}
233
234func (t *singleObjectTask) initialTimeout() time.Duration {
235 config := cmn.GCO.Get()

Callers 1

downloadMethod · 0.95

Calls 5

initialTimeoutMethod · 0.95
wrapReaderMethod · 0.95
ReadWrapperFuncFuncType · 0.92
SetSizeFuncFuncType · 0.92
GetColdMethod · 0.65

Tested by

no test coverage detected