Commit 6116d52a authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f4ac3442
...@@ -101,6 +101,7 @@ type Key = int64 ...@@ -101,6 +101,7 @@ type Key = int64
type ΔTail struct { type ΔTail struct {
δBtail []ΔRevEntry // BTree changes; Covers keys ∈ tracket subset δBtail []ΔRevEntry // BTree changes; Covers keys ∈ tracket subset
δZtail *zodb.ΔTail // raw ZODB changes; Kept to rebuild δBtail after new Track δZtail *zodb.ΔTail // raw ZODB changes; Kept to rebuild δBtail after new Track
// head zodb.Tid // δBtail currently has coverage till head], δZtail can have more
// 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
...@@ -135,7 +136,7 @@ func NewΔTail(at0 zodb.Tid) *ΔTail { ...@@ -135,7 +136,7 @@ func NewΔTail(at0 zodb.Tid) *ΔTail {
// Head is similar to zodb.ΔTail.Head . XXX ok? // Head is similar to zodb.ΔTail.Head . XXX ok?
func (δb *ΔTail) Head() zodb.Tid { func (δb *ΔTail) Head() zodb.Tid {
return δb.δZtail.Head() return δb.head
} }
// Tail is similar to zodb.ΔTail.Tail . XXX ok? // Tail is similar to zodb.ΔTail.Tail . XXX ok?
...@@ -174,6 +175,13 @@ func (δb *ΔTail) Track(path []Node) { // XXX Tree|Bucket; path[0] = root ...@@ -174,6 +175,13 @@ func (δb *ΔTail) Track(path []Node) { // XXX Tree|Bucket; path[0] = root
func (δB *ΔTail) Update(δZ *zodb.EventCommit) { func (δB *ΔTail) Update(δZ *zodb.EventCommit) {
/* /*
.δZtail += δZ .δZtail += δZ
.update()
*/
// update brings .δBtail up to date by recomputing diff XXX and taking new
// entries in .δZtail into account.
func (δB *ΔTail) update() {
/*
δbZ = {} δbZ = {}
for δ in δZ: for δ in δZ:
.rootIdx[δ]: .rootIdx[δ]:
......
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