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

Method putRemote

ais/tgtobj.go:313–332  ·  view source on GitHub ↗

via backend.PutObj()

()

Source from the content-addressed store, hash-verified

311
312// via backend.PutObj()
313func (poi *putObjInfo) putRemote() (errCode int, err error) {
314 var (
315 lom = poi.lom
316 backend = poi.t.Backend(lom.Bck())
317 )
318 lmfh, err := cos.NewFileHandle(poi.workFQN)
319 if err != nil {
320 err = cmn.NewErrFailedTo(poi.t, "open", poi.workFQN, err)
321 return
322 }
323 if poi.owt == cmn.OwtPut && !lom.Bck().IsRemoteAIS() {
324 // some/all of those are set by the backend.PutObj()
325 lom.ObjAttrs().DelCustomKeys(cmn.SourceObjMD, cmn.CRC32CObjMD, cmn.ETag, cmn.MD5ObjMD, cmn.VersionObjMD)
326 }
327 errCode, err = backend.PutObj(lmfh, lom)
328 if err == nil && !lom.Bck().IsRemoteAIS() {
329 lom.SetCustomKey(cmn.SourceObjMD, backend.Provider())
330 }
331 return
332}
333
334// LOM is updated at the end of this call with size and checksum.
335// `poi.r` (reader) is also closed upon exit.

Callers 1

finiMethod · 0.95

Calls 10

NewFileHandleFunction · 0.92
NewErrFailedToFunction · 0.92
DelCustomKeysMethod · 0.80
ObjAttrsMethod · 0.80
BackendMethod · 0.65
BckMethod · 0.65
PutObjMethod · 0.65
SetCustomKeyMethod · 0.65
ProviderMethod · 0.65
IsRemoteAISMethod · 0.45

Tested by

no test coverage detected