MCPcopy Create free account
hub / github.com/amit-davidson/Building-a-NoSQL-database-from-zero / split

Method split

Part 7/node.go:300–325  ·  view source on GitHub ↗

split rebalances the tree after adding. After insertion the modified node has to be checked to make sure it didn't exceed the maximum number of elements. If it did, then it has to be split and rebalanced. The transformation is depicted in the graph below. If it's not a leaf node, then the children h

(nodeToSplit *Node, nodeToSplitIndex int)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

PutMethod · 0.45

Calls 6

writeNodeMethod · 0.95
addItemMethod · 0.95
writeNodesMethod · 0.95
getSplitIndexMethod · 0.45
isLeafMethod · 0.45
newNodeMethod · 0.45

Tested by

no test coverage detected