Commit a6760d8f authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 953f1978
......@@ -605,6 +605,10 @@ func (prs *rangeSplit) GetToBucket(ctx context.Context, k Key) (rbucket *nodeInR
}
func (rs rangeSplit) String() string {
if len(rs) == 0 {
return "ø"
}
s := ""
for _, rn := range rs {
if s != "" {
......@@ -726,7 +730,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
Adone := SetKey{} // "processed" keys on A
Bdone := SetKey{} // "processed" keys on B
if b != nil {
if b != nil { // XXX kill (always !nil) ?
// XXX precise range as for a ^^^ ?
btop := &nodeInRange{lo: KeyMin, hi_: KeyMax, node: b} // [-∞, ∞)
bv = rangeSplit{btop}
......@@ -734,7 +738,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
// initial phase: expand changed nodes in a till buckets;
// XXX changed buckets -> δ-
if a != nil {
if a != nil { // XXX kill (always !nil) ?
// XXX maybe walk till a from root to get more precise initial range?
atop := &nodeInRange{lo: KeyMin, hi_: KeyMax, node: a} // [-∞, ∞)
av = rangeSplit{atop}
......@@ -771,12 +775,19 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
return nil, err
}
// XXX Adone <- δA
// XXX Bqueue <- δA
// Adone <- δA
// Bqueue <- δA
for k := range δA {
Adone.Add(k)
Bqueue.Add(k)
}
}
}
}
}
fmt.Printf(" av: %s\n", av)
fmt.Printf(" bv: %s\n", bv)
// phase 2: iterate through keys queued for A and B, delve into
// corresponding nodes, and merge diff generated from them into δ.
......@@ -916,7 +927,7 @@ func __diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oi
bv = b.Entryv() // key↑
}
fmt.Printf(" av: %s\n", vtree(av))
fmt.Printf(" bv: %v\n", vtree(bv))
fmt.Printf(" bv: %s\n", vtree(bv))
δ = map[Key]ΔValue{}
defer fmt.Printf(" -> δt: %v\n", δ)
......
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