MCPcopy
hub / github.com/deepflowio/deepflow / DropOrg

Function DropOrg

server/common/module_shared.go:116–128  ·  view source on GitHub ↗

* * 调用此接口删除组织时,ingester 会删除 ClickHouse 中所有该组织的数据库,并清理内存中对应的 ClickHouse session。 * 注意:当 deepflow-agent 携带的 org_id 在 ClickHouse 中没有对应的数据库时, * 同时满足下面两个条件,则 ingester 会自动为该 org_id 创建 ClickHouse 数据库: * 1. ingester 最近一次(每分钟获取一次)从 controller 获取到的 org_id list 中存在该 org_id * 2. 该 org_id 最近没有被删除过,或者被删除的时间早于 ing

(orgId uint16)

Source from the content-addressed store, hash-verified

114* Additionally, please note that when an org is deleted, the controller needs to ensure that the issued org_i list does not contain the deleted org_id.
115 */
116func DropOrg(orgId uint16) error {
117 log.Info("drop org id:", orgId)
118 if ingesterOrgHanders == nil {
119 return fmt.Errorf("ingesterOrgHanders is nil, drop org id %d failed", orgId)
120 }
121 for _, ingesterOrgHander := range ingesterOrgHanders {
122 err := ingesterOrgHander.DropOrg(orgId)
123 if err != nil {
124 return err
125 }
126 }
127 return nil
128}
129
130// When starting, you need to call the interface
131func PushNativeTags(orgId uint16, nativeTags []nativetag.NativeTag) {

Callers

nothing calls this directly

Calls 3

DropOrgMethod · 0.65
InfoMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected