MCPcopy Create free account
hub / github.com/AbelChe/evil_minio / replace

Method replace

cmd/data-usage-cache.go:518–530  ·  view source on GitHub ↗

replace will add or replace an entry in the cache. If a parent is specified it will be added to that if not already there. If the parent does not exist, it will be added.

(path, parent string, e dataUsageEntry)

Source from the content-addressed store, hash-verified

516// If a parent is specified it will be added to that if not already there.
517// If the parent does not exist, it will be added.
518func (d *dataUsageCache) replace(path, parent string, e dataUsageEntry) {
519 hash := hashPath(path)
520 if d.Cache == nil {
521 d.Cache = make(map[string]dataUsageEntry, 100)
522 }
523 d.Cache[hash.Key()] = e
524 if parent != "" {
525 phash := hashPath(parent)
526 p := d.Cache[phash.Key()]
527 p.addChild(hash)
528 d.Cache[phash.Key()] = p
529 }
530}
531
532// replaceHashed add or replaces an entry to the cache based on its hash.
533// If a parent is specified it will be added to that if not already there.

Callers 4

nsScannerMethod · 0.95
AddVersionMethod · 0.45
TestXLV2FormatDataFunction · 0.45

Calls 3

hashPathFunction · 0.85
addChildMethod · 0.80
KeyMethod · 0.45

Tested by 2

TestXLV2FormatDataFunction · 0.36