Commit 8456cefd authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 8be186ba
......@@ -82,7 +82,9 @@ type Value = zodb.Oid // XXX assumes key points to IPersistent
// ΔBTail is not safe for concurrent access.
// XXX -> multiple readers / single writer?
type ΔBtail struct {
δZtail *zodb.ΔTail // raw ZODB changes; Kept to rebuild δBtail/byRoot after new Track
// raw ZODB changes; Kept to rebuild δBtail/byRoot after new Track.
// includes all changed objects, not only tracked ones.
δZtail *zodb.ΔTail
δRtail []ΔRoots // which BTree were changed; Noted only by keys ∈ tracket subset
byRoot map[*Tree]*ΔTreeTail // root -> k/v change history; only for keys ∈ tracket subset
......@@ -151,16 +153,9 @@ func newΔTtail() *ΔTreeTail {
}
}
// Head is similar to zodb.ΔTail.Head . XXX ok?
func (δBtail *ΔBtail) Head() zodb.Tid {
//return δb.head
return δBtail.δZtail.Head()
}
// Tail is similar to zodb.ΔTail.Tail . XXX ok?
func (δBtail *ΔBtail) Tail() zodb.Tid {
return δBtail.δZtail.Tail()
}
// (tail, head] coverage
func (δBtail *ΔBtail) Head() zodb.Tid { return δBtail.δZtail.Head() }
func (δBtail *ΔBtail) Tail() zodb.Tid { return δBtail.δZtail.Tail() }
// XXX SliceByRev?
// XXX ForgetPast
......@@ -209,6 +204,8 @@ func (δBtail *ΔBtail) Track(path []Node) { // XXX Tree|Bucket; path[0] = root
// Only those objects from δZ that belong to tracked set are guaranteed to be
// taken into account. In other words a tree history will assuredly include
// only those keys, that correspond to tracked subset of δZ.
//
// δZ should include all objects changed by ZODB transaction.
func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) Δ {
δBtail.δZtail.Append(δZ.Tid, δZ.Changev)
......
......@@ -83,9 +83,9 @@ func NewΔFtail(at0 zodb.Tid) *ΔFtail {
}
}
// XXX
func (δFtail *ΔFtail) Head() zodb.Tid { panic("TODO") }
func (δFtail *ΔFtail) Tail() zodb.Tid { panic("TODO") }
// (tail, head] coverage
func (δFtail *ΔFtail) Head() zodb.Tid { return δFtail.δBtail.Head() }
func (δFtail *ΔFtail) Tail() zodb.Tid { return δFtail.δBtail.Tail() }
// Track adds tree path to tracked set and associates path root with file.
......@@ -117,6 +117,8 @@ func (δFtail *ΔFtail) Track(file *BigFile, path []btree.LONode) {
// Update updates δFtail given raw ZODB changes.
//
// It returns change in files space that corresponds to δZ.
//
// δZ should include all objects changed by ZODB transaction.
func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) ΔF {
δB := δFtail.δBtail.Update(δZ)
δF := ΔF{Rev: δB.Rev, Change: make(map[*BigFile]SetI64)}
......
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