Commit f319974a authored by Kirill Smelkov's avatar Kirill Smelkov

.

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