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

Function buildDlObjs

downloader/utils.go:54–72  ·  view source on GitHub ↗

buildDlObjs returns list of objects that must be downloaded by target.

(t cluster.Target, bck *cluster.Bck, objects cos.SimpleKVs)

Source from the content-addressed store, hash-verified

52
53// buildDlObjs returns list of objects that must be downloaded by target.
54func buildDlObjs(t cluster.Target, bck *cluster.Bck, objects cos.SimpleKVs) ([]dlObj, error) {
55 var (
56 smap = t.Sowner().Get()
57 sid = t.SID()
58 )
59
60 objs := make([]dlObj, 0, len(objects))
61 for name, link := range objects {
62 obj, err := makeDlObj(smap, sid, bck, name, link)
63 if err != nil {
64 if err == errInvalidTarget {
65 continue
66 }
67 return nil, err
68 }
69 objs = append(objs, obj)
70 }
71 return objs, nil
72}
73
74func makeDlObj(smap *cluster.Smap, sid string, bck *cluster.Bck, objName, link string) (dlObj, error) {
75 objName, err := NormalizeObjName(objName)

Callers 1

newSliceDlJobFunction · 0.85

Calls 4

makeDlObjFunction · 0.85
GetMethod · 0.65
SownerMethod · 0.65
SIDMethod · 0.65

Tested by

no test coverage detected