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

Method Remove

cluster/lom.go:476–494  ·  view source on GitHub ↗
(force ...bool)

Source from the content-addressed store, hash-verified

474}
475
476func (lom *LOM) Remove(force ...bool) (err error) {
477 // making "rlock" exception to be able to (forcefully) remove corrupted obj in the GET path
478 debug.AssertFunc(func() bool {
479 rc, exclusive := lom.IsLocked()
480 return exclusive || (len(force) > 0 && force[0] && rc > 0)
481 })
482 lom.Uncache(true /*delDirty*/)
483 err = cos.RemoveFile(lom.FQN)
484 if os.IsNotExist(err) {
485 err = nil
486 }
487 for copyFQN := range lom.md.copies {
488 if erc := cos.RemoveFile(copyFQN); erc != nil && !os.IsNotExist(erc) {
489 err = erc
490 }
491 }
492 lom.md.bckID = 0
493 return
494}
495
496//
497// evict lom cache

Callers 15

createFunction · 0.45
RunMethod · 0.45
runMethod · 0.45
RemoveFileFunction · 0.45
SaveReaderFunction · 0.45
SaveReaderSafeFunction · 0.45
LoadFunction · 0.45
receiveCTMethod · 0.45
updateSymlinkFunction · 0.45
prepareLogFileTmpDirFunction · 0.45
logoutUserHandlerFunction · 0.45
getObjectFunction · 0.45

Calls 4

IsLockedMethod · 0.95
UncacheMethod · 0.95
AssertFuncFunction · 0.92
RemoveFileFunction · 0.92

Tested by 14

benchFileFunction · 0.36
BenchmarkObjPutFunction · 0.36
BenchmarkObjAppendFunction · 0.36
BenchmarkObjGetDiscardFunction · 0.36
createInputShardsMethod · 0.36
TestGetFromArchiveFunction · 0.36
repairMountpathFunction · 0.36
doECPutsAndCheckFunction · 0.36
TestECChecksumFunction · 0.36
TestECXattrsFunction · 0.36