Commit e215d7e6 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 011fafc5
......@@ -40,6 +40,7 @@ type Tree = btree.LOBTree
type Bucket = btree.LOBucket
type Node = btree.LONode
type TreeEntry = btree.LOEntry
type BucketEntry = btree.LOBucketEntry
type Key = int64
......@@ -417,19 +418,24 @@ func diffX(ctx context.Context, a, b Node, δZTC SetOid) (δ map[Key]Value, err
func diffT(ctx context.Context, a, b *Tree, δZTC SetOid) (δ map[Key]Value, err error) {
fmt.Printf(" T %s %s\n", xidOf(a), xidOf(b))
defer xerr.Contextf(&err, "diffT %s %s", xidOf(a), xidOf(b))
if a.POid() != b.POid() {
if (a != nil && b != nil) && (a.POid() != b.POid()) {
panic("different trees")
}
// XXX a/b = nil - means del/add -> handle
var av []TreeEntry
var bv []TreeEntry
if a != nil {
err = a.PActivate(ctx); if err != nil { return nil, err }
defer a.PDeactivate()
av = a.Entryv() // key↑
}
if b != nil {
err = b.PActivate(ctx); if err != nil { return nil, err }
defer b.PDeactivate()
bv = b.Entryv() // key↑
}
av := a.Entryv() // key↑
bv := b.Entryv() // key↑
δ = map[Key]Value{}
// [i].Key ≤ [i].Child.*.Key < [i+1].Key i ∈ [0, len([]))
......@@ -494,11 +500,10 @@ func diffB(ctx context.Context, a, b *Bucket) (δ map[Key]Value, err error) {
fmt.Printf(" B %s %s\n", xidOf(a), xidOf(b))
defer xerr.Contextf(&err, "diffB %s %s", xidOf(a), xidOf(b))
// XXX oid can be InvalidOid for T/B... (i.e. B is part of T and is not yet committed separately)
if a.POid() != b.POid() {
if (a != nil && b != nil) && (a.POid() != b.POid()) {
panic("different buckets")
}
// XXX a/b = nil - means del/add -> handle
var av []BucketEntry
var bv []BucketEntry
......
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