Commit d37761bb authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 61d79c05
......@@ -29,11 +29,8 @@ import (
"lab.nexedi.com/nexedi/wendelin.core/wcfs/internal/xbtree/blib"
)
// RTree represents Tree node that RBucket refers to as parent.
type RTree struct {
Oid zodb.Oid
Parent *RTree
}
// RBucketSet represents set of buckets covering whole [-∞,∞) range.
type RBucketSet []*RBucket // k↑
// RBucket represents Bucket node with values covering [lo, hi_] key range in its Tree.
// NOTE it is not [lo,hi) but [lo,hi_] instead to avoid overflow at KeyMax.
......@@ -44,6 +41,13 @@ type RBucket struct {
KV map[Key]string // bucket's k->v; values were ZBlk objects whose data is loaded instead.
}
// RTree represents Tree node that RBucket refers to as parent.
type RTree struct {
Oid zodb.Oid
Parent *RTree
}
// Path returns path to this bucket from tree root.
func (rb *RBucket) Path() []zodb.Oid {
path := []zodb.Oid{rb.Oid}
......@@ -55,10 +59,6 @@ func (rb *RBucket) Path() []zodb.Oid {
return path
}
// RBucketSet represents set of buckets covering whole [-∞,∞) range.
type RBucketSet []*RBucket // k↑
// Get returns RBucket which covers key k.
func (rbs RBucketSet) Get(k Key) *RBucket {
i := sort.Search(len(rbs), func(i int) bool {
......
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