Commit 340f7659 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6174e198
...@@ -49,9 +49,11 @@ type Key = int64 ...@@ -49,9 +49,11 @@ type Key = int64
// //
// XXX incremental; not full coverage // XXX incremental; not full coverage
// XXX concurrency safety // XXX concurrency safety
//
// XXX see also zodb.ΔTail .
type ΔTail struct { type ΔTail struct {
//at // = head δBtail []ΔRevEntry // BTree changes; Covers keys ∈ tracket subset
δZtail *zodb.ΔTail δZtail *zodb.ΔTail // raw ZODB changes; Kept to rebuild δBtail after new Track
// XXX or ask client provide db on every call? // XXX or ask client provide db on every call?
db *zodb.DB // to open connections to load new/old tree|buckets db *zodb.DB // to open connections to load new/old tree|buckets
...@@ -73,6 +75,30 @@ type ΔTree struct { ...@@ -73,6 +75,30 @@ type ΔTree struct {
Keyv []Key Keyv []Key
} }
// NewΔTail creats new ΔTail object.
//
// Initial tracked set is empty.
// Initial coverage is (at₀, at₀].
func NewΔTail(at0 zodb.Tid) *ΔTail {
return &ΔTail{
δZtail: zodb.NewΔTail(at0),
root: make(map[zodb.Oid]SetTree),
}
}
// Head is similar to zodb.ΔTail.Head . XXX ok?
func (δb *ΔTail) Head() zodb.Tid {
return δb.δZtail.Head()
}
// Tail is similar to zodb.ΔTail.Tail . XXX ok?
func (δb *ΔTail) Tail() zodb.Tid {
return δb.δZtail.Tail()
}
// XXX SliceByRev?
// XXX ForgetPast
// Track adds tree path to tracked set. // Track adds tree path to tracked set.
// //
// XXX tailv is rebuild to also include keys corresponding to added nodes. // XXX tailv is rebuild to also include keys corresponding to added nodes.
......
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