MCPcopy Create free account
hub / github.com/deepflowio/deepflow / Add

Method Add

server/controller/recorder/cache/tool/collection.go:117–126  ·  view source on GitHub ↗
(dbItem D)

Source from the content-addressed store, hash-verified

115}
116
117func (oc *collection[T, D]) Add(dbItem D) {
118 item := oc.cacheItemFactory()
119 item.reset(dbItem, oc.tool)
120 oc.lcuuidToItem[dbItem.GetLcuuid()] = item
121 oc.idToItem[dbItem.GetID()] = item
122 if oc.extender != nil {
123 oc.extender.OnAfterAdd(item, dbItem)
124 }
125 oc.tool.GetLogFunc()(addToToolMap(oc.resourceType, dbItem.GetLcuuid()), oc.tool.metadata.LogPrefixes)
126}
127
128func (oc *collection[T, D]) Update(dbItem D) {
129 if existingItem, ok := oc.idToItem[dbItem.GetID()]; ok {

Callers 14

UpdateMethod · 0.95
GetOrLoadByLcuuidMethod · 0.95
GetOrLoadByIDMethod · 0.95
GetOrLoadByIPMethod · 0.45
TestAZCollectionFunction · 0.45
AddPodGroupIDMethod · 0.45
afterDeletePageMethod · 0.45
generateAllIDSetMethod · 0.45
generateUsedIDSetMethod · 0.45
generateUsedIDSetMethod · 0.45
loadMethod · 0.45

Calls 6

addToToolMapFunction · 0.85
resetMethod · 0.65
GetLcuuidMethod · 0.65
GetIDMethod · 0.65
OnAfterAddMethod · 0.65
GetLogFuncMethod · 0.45

Tested by 1

TestAZCollectionFunction · 0.36