-
Notifications
You must be signed in to change notification settings - Fork 316
Closed
Description
Refactor API to split functionality into mutable and immutable interfaces. This will enable read only snapshots to previously stored versions, (fixing #68, see also #87). With these changes, it will be possible to load read-only snapshots at previous versions on demand, and only load mutable trees at the most recently saved tree. This should speed up load times for trees with many versions, as we are currently loading each root into memory, which takes a linear number of database calls.
Steps:
- Replace Tree with ImmutableTree
- Merge VersionedTree and orphaningTree into MutableTree
- Move mutable methods on Tree into MutableTree
- Move recursive mutation methods on Node into MutableTree
- Move recursive lookup methods on Node into ImmutableTree
High level overview of resulting interfaces:
MutableTree
- tree *ImmutableTree
- Load()
- Set(key, value)
- Remove(key)
- Commit()
- Rollback()
- GetImmutable(version)
- DeleteImmutable(version)
ImmutableTree
- root *Node
- Has(key)
- Get(key)
- GetWithProof(key)
- GetByIndex(index)
- IterateRange(start, end)
- GetRangeWithProof(start, end)
- Hash()
- Size()
- Version()
Node
- isLeaf()
- hash()
- getLeftNode()
- getRightNode()
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels