(cluster *LogCluster)
| 212 | } |
| 213 | |
| 214 | func (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 | |
| 227 | func (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. |
no test coverage detected