Commit 700f6028 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent ca074426
......@@ -34,7 +34,7 @@ package xbtree
//
// Because it is very computationally expensive(+) to find out for an object to
// which BTree it belongs, ΔBtail cannot provide full BTree-level history given
// just ΔZtail with δZ changes. Because of this ΔBtail requires help from
// just ΔZtail with δZ changes. Due to this ΔBtail requires help from
// users, which are expected to call ΔBtail.Track(treepath) to let ΔBtail know
// that such and such ZODB objects constitute a path from root of a tree to some
// of its leaf. After Track call the objects from the path and tree keys, that
......@@ -310,18 +310,15 @@ func (δBtail *ΔBtail) Tail() zodb.Tid { return δBtail.δZtail.Tail() }
// Track adds tree path to tracked set.
//
// path[0] signifies tree root.
// All path elements must be Tree except last one which, for non-empty tree, must be Bucket.
// path[-1] signifies leaf node.
// keycov should be key range covered by the leaf node.
//
// Besides key (which might point to value or hole), δBtail will also track all XXX
// keys covered by leaf node. In particular after request for KeyMax or KeyMin
// to be tracked, δBtail will keep on tracking changes to maximum or minimum
// keys correspondingly.
// ΔBtail will start tracking provided tree nodes and keys ∈ keycov.
//
// Objects in path must be with .PJar().At() == .Head()
func (δBtail *ΔBtail) Track(keycov KeyRange, nodePath []Node) {
// NOTE key not needed for anything besides tracing XXX kill comment
// (tracking set will be added with all keys, covered by leaf keyrange)
// All path elements must be Tree except last one which, for non-empty tree, must be Bucket.
//
// Objects in the path must be with .PJar().At() == .Head()
func (δBtail *ΔBtail) Track(nodePath []Node, keycov KeyRange) {
if traceΔBtail {
pathv := []string{}
for _, node := range nodePath { pathv = append(pathv, vnode(node)) }
......@@ -338,7 +335,7 @@ func (δBtail *ΔBtail) Track(keycov KeyRange, nodePath []Node) {
}
path := nodePathToPath(nodePath)
δBtail.track(keycov, path)
δBtail.track(path, keycov)
}
// nodePathToPath converts path from []Node to []Oid.
......@@ -366,7 +363,7 @@ func nodePathToPath(nodePath []Node) (path []zodb.Oid) {
return path
}
func (δBtail *ΔBtail) track(keycov KeyRange, path []zodb.Oid) {
func (δBtail *ΔBtail) track(path []zodb.Oid, keycov KeyRange) {
// XXX locking
// first normalize path: remove embedded bucket and check if it was an
......
......@@ -1768,7 +1768,7 @@ func trackKeys(δbtail *ΔBtail, t *xbtreetest.Commit, keys setKey) {
// tracking set. By aligning initial state to the same as after
// T1->ø, we test what will happen on ø->T2.
b := t.Xkv.Get(k)
δbtail.track(b.Keycov, b.Path())
δbtail.track(b.Path(), b.Keycov)
}
}
......
......@@ -225,7 +225,7 @@ func (δFtail *ΔFtail) Track(file *ZBigFile, blk int64, path []btree.LONode, bl
// if blk == -1 {
// blk = xbtree.KeyMax
// }
δFtail.δBtail.Track(blkcov, path)
δFtail.δBtail.Track(path, blkcov)
rootObj := path[0].(*btree.LOBTree)
root := rootObj.POid()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment