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

Method detectLocalCT

reb/ec.go:243–260  ·  view source on GitHub ↗

Check if this target has a metadata for the received CT

(req *stageNtfn, ct *cluster.CT)

Source from the content-addressed store, hash-verified

241
242// Check if this target has a metadata for the received CT
243func (reb *Reb) detectLocalCT(req *stageNtfn, ct *cluster.CT) (*ec.Metadata, error) {
244 if req.action == rebActMoveCT {
245 // internal CT move after slice conflict - save always
246 return nil, nil
247 }
248 if _, ok := req.md.Daemons[reb.t.SID()]; !ok {
249 return nil, nil
250 }
251 mdCT, err := cluster.NewCTFromBO(ct.Bck().Bucket(), ct.ObjectName(), reb.t.Bowner(), fs.ECMetaType)
252 if err != nil {
253 return nil, err
254 }
255 locMD, err := ec.LoadMetadata(mdCT.FQN())
256 if err != nil && os.IsNotExist(err) {
257 err = nil
258 }
259 return locMD, err
260}
261
262// When a target receives a slice and the target has a slice with different ID:
263// - move slice to a workfile directory

Callers 1

receiveCTMethod · 0.95

Calls 8

NewCTFromBOFunction · 0.92
LoadMetadataFunction · 0.92
FQNMethod · 0.80
SIDMethod · 0.65
BucketMethod · 0.65
BckMethod · 0.65
ObjectNameMethod · 0.65
BownerMethod · 0.65

Tested by

no test coverage detected