MCPcopy
hub / github.com/grafana/tempo / addClusterToRootNode

Method addClusterToRootNode

pkg/drain/drain.go:214–225  ·  view source on GitHub ↗
(cluster *LogCluster)

Source from the content-addressed store, hash-verified

212}
213
214func (d *Drain) addClusterToRootNode(cluster *LogCluster) {
215 tokenCount := len(cluster.Tokens)
216 tokenCountStr := strconv.Itoa(tokenCount)
217
218 curNode, ok := d.rootNode.keyToChildNode[tokenCountStr]
219 if !ok {
220 curNode = newNode()
221 d.rootNode.keyToChildNode[tokenCountStr] = curNode
222 }
223
224 d.addClusterToNode(curNode, cluster.id, cluster.Tokens, tokenCount, 1)
225}
226
227func (d *Drain) addClusterToNode(curNode *Node, clusterID int, tokens []string, totalTokens int, currentDepth int) {
228 // If we can't descend any further, add the cluster ID to the node.

Callers 1

trainMethod · 0.95

Calls 2

addClusterToNodeMethod · 0.95
newNodeFunction · 0.85

Tested by

no test coverage detected