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

Method CompareObjects

ais/target.go:1442–1455  ·  view source on GitHub ↗

supporting methods CheckRemoteVersion sets `vchanged` to true if object versions differ between remote object and local cache. NOTE: Should be called only if the local copy exists.

(ctx context.Context, lom *cluster.LOM)

Source from the content-addressed store, hash-verified

1440// remote object and local cache.
1441// NOTE: Should be called only if the local copy exists.
1442func (t *target) CompareObjects(ctx context.Context, lom *cluster.LOM) (equal bool, errCode int, err error) {
1443 var objAttrs *cmn.ObjAttrs
1444 objAttrs, errCode, err = t.Backend(lom.Bck()).HeadObj(ctx, lom)
1445 if err != nil {
1446 err = cmn.NewErrFailedTo(t, "head metadata of", lom, err)
1447 return
1448 }
1449 if lom.Bck().IsHDFS() {
1450 equal = true // no versioning in HDFS
1451 return
1452 }
1453 equal = lom.Equal(objAttrs)
1454 return
1455}
1456
1457func (t *target) listBuckets(w http.ResponseWriter, r *http.Request, qbck *cmn.QueryBcks) {
1458 const fmterr = "failed to list %q buckets: [%v]"

Callers

nothing calls this directly

Calls 6

BackendMethod · 0.95
NewErrFailedToFunction · 0.92
HeadObjMethod · 0.65
BckMethod · 0.65
IsHDFSMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected