add NodeStore

This commit is contained in:
Chris Lu
2021-09-18 15:32:17 -07:00
parent 198fa58e3c
commit e066e2642c
7 changed files with 147 additions and 91 deletions

View File

@@ -9,9 +9,9 @@ import (
*/
type BpMap BpTree
func NewBpMap(node_size int) *BpMap {
func NewBpMap(node_size int, nodeStore NodeStore) *BpMap {
return &BpMap{
root: NewLeaf(node_size),
root: NewLeaf(node_size, nodeStore),
}
}
@@ -47,7 +47,7 @@ func (self *BpMap) Remove(key ItemKey) (value ItemValue, err error) {
return nil, err
}
if new_root == nil {
new_root = NewLeaf(ns)
new_root = NewLeaf(ns, self.root.nodeStore)
err = new_root.persist()
self.setRoot(new_root)
} else {