Represents a branch of a meta data tree, used to organize timeseries into a hierarchy for easy navigation. Each branch is composed of itself and potential child branches and/or child leaves.
Branch IDs are hex encoded byte arrays composed of the tree ID + hash of the display name for each previous branch. The tree ID is encoded on {@link Tree#TREE_ID_WIDTH()} bytes, each hash is then {@code INT_WIDTH} bytes. So the if the tree ID width is 2 bytes and Java Integers are 4 bytes, the root for tree # 1 is just {@code 0001}. A child of the root could be {@code 00001A3B190C2} and so on. These IDs are used as the row key in storage.
Branch definitions are JSON objects stored in the "branch" column of the branch ID row. Only the tree ID, path and display name are stored in the definition column to keep space down. Leaves are stored in separate columns and child branch definitions are stored in separate rows. Note that the root branch definition for a tree will be stored in the same row as the tree definition since they share the same row key.
When fetching a branch with children and leaves, a scanner is configured with a row key regex to scan any rows that match the branch ID plus an additional {@code INT_WIDTH} so that when we scan, we can pick up allof the rows with child branch definitions. Also, when loading a full branch, any leaves for the request branch can load the associated UID names from storage, so this can get expensive. Leaves for a child branch will not be loaded, only leaves that belong directly to the local will. Also, children branches of children will not be loaded. We only return one branch at a time since the tree could be HUGE!
Storing a branch will only write the definition column for the local branch object. Child branches will not be written to storage. If you've loaded and modified children in this branch, you need to loop through the children and store them individually. Leaves belonging to this branch will be stored and collisions recorded to the given Tree object.
@since 2.0