Commit d5a07d5f authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 3c207b7c
...@@ -527,6 +527,17 @@ func (rc rangeCover) Get(k Key) *nodeInRange { ...@@ -527,6 +527,17 @@ func (rc rangeCover) Get(k Key) *nodeInRange {
return rn return rn
} }
func (rc rangeCover) String() string {
s := ""
for _, rn := range rc {
if s != "" {
s += " "
}
s += fmt.Sprintf("[%v,%v]%s", rn.lo, rn.hi_, vnode(rn.node))
}
return s
}
// treediff computes δT for tree specified by root in between old..new. // treediff computes δT for tree specified by root in between old..new.
...@@ -1078,16 +1089,19 @@ func vtree(v []TreeEntry) string { ...@@ -1078,16 +1089,19 @@ func vtree(v []TreeEntry) string {
if s != "" { if s != "" {
s += " " s += " "
} }
c := e.Child() s += fmt.Sprintf("%v %s", e.Key(), vnode(e.Child()))
ckind := "?"
switch c.(type) {
case *Tree: ckind = "T"
case *Bucket: ckind = "B"
} }
return s
}
s += fmt.Sprintf("%v %s%s", e.Key(), ckind, c.POid()) // vnode returns brief huan-readable representation of node.
func vnode(node Node) string {
kind := "?"
switch node.(type) {
case *Tree: kind = "T"
case *Bucket: kind = "B"
} }
return s return fmt.Sprintf("%s%s", kind, node.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