Package net.sodacan.core.util
Class BBBTree
java.lang.Object
net.sodacan.core.util.BBBTree
This BTree can exist on disk. Changes made in memory don't immediately get sent to disk. Rather, commit is done on commit. Only changed nodes are written.
A "new" node has two meanings. New-to-memory and completely-new. A node that's new to memory will have a reference pointer while a completely new node will not at the time it is created.
In order to avoid bringing the whole tree into memory when we access the root node nodes children are realized lazily.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
commit()
Save all the updated and new nodesgetAlloc()
getNodeString
(Integer ref) getRoot()
void
setRoot
(BBBTree.Node root) void
-
Field Details
-
INITIAL_NODE_ALLOCATION
public static final int INITIAL_NODE_ALLOCATION- See Also:
-
-
Constructor Details
-
BBBTree
-
-
Method Details
-
store
-
store
-
getNodeString
-
commit
public void commit()Save all the updated and new nodes -
getAlloc
-
getChangedNodes
-
getRoot
-
setRoot
-