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