Commit f319974a authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6db32a78
......@@ -26,6 +26,8 @@
//
// node.Entryv() returns [] of (key, child/value).
//
// BTree.FirstBucket() and Bucket.Next() allows to iterate in terms of B⁺ tree nodes.
//
// --------
//
// (*) https://github.com/zopefoundation/ZODB/blob/3.10.7-4-gb8d7a8567/src/BTrees/Development.txt#L211
......
......@@ -133,6 +133,18 @@ func (b *Bucket) Entryv() []BucketEntry {
return ev
}
// ---- node-level iteration ----
// XXX
func (t *BTree) FirstBucket() *Bucket {
return t.firstbucket
}
// XXX
func (b *Bucket) Next() *Bucket {
return b.next
}
// ---- point query ----
// Get searches BTree by key.
......@@ -226,6 +238,7 @@ func (t *BTree) MinKey(ctx context.Context) (_ KEY, _ bool, err error) {
return 0, false, nil
}
// XXX -> just use t.firstBucket
for {
child := t.data[0].child.(zodb.IPersistent)
t.PDeactivate()
......
......@@ -135,6 +135,18 @@ func (b *IOBucket) Entryv() []IOBucketEntry {
return ev
}
// ---- node-level iteration ----
// XXX
func (t *IOBTree) FirstBucket() *IOBucket {
return t.firstbucket
}
// XXX
func (b *IOBucket) Next() *IOBucket {
return b.next
}
// ---- point query ----
// Get searches IOBTree by key.
......
......@@ -135,6 +135,18 @@ func (b *LOBucket) Entryv() []LOBucketEntry {
return ev
}
// ---- node-level iteration ----
// XXX
func (t *LOBTree) FirstBucket() *LOBucket {
return t.firstbucket
}
// XXX
func (b *LOBucket) Next() *LOBucket {
return b.next
}
// ---- point query ----
// Get searches LOBTree by key.
......
......@@ -58,6 +58,7 @@ import (
type Persistent struct {
// ZODB class of this object.
// XXX it could be deduced via typeTab[reflect.TypeOf(.instance)]
// XXX or better drop .instance and deduce it via casting to .zclass.typ
zclass *zclass
jar *Connection
......
......@@ -326,6 +326,9 @@ type IStorage interface {
IStorageDriver
Prefetcher
//Loader
//Iterator
//XXXNotifier() -> Notifier // dedicated notifier for every open?
}
// Prefetcher provides functionality to prefetch objects.
......@@ -362,8 +365,8 @@ type IStorageDriver interface {
// The notifier represents invalidation channel (notify about changes
// made to DB not by us from outside). XXX
//
// To simplify drivets, there must be only 1 logical user of
// storage-driver level notifier interface. Ccontrary IStorage allows
// To simplify drivers, there must be only 1 logical user of
// storage-driver level notifier interface. Contrary IStorage allows
// for several users of notification channel. XXX ok?
//
// XXX -> nil, if driver does not support notifications?
......
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