Commit 5aac8b0d authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent d99b1b41
...@@ -93,7 +93,8 @@ type ΔBtail struct { ...@@ -93,7 +93,8 @@ type ΔBtail struct {
// includes all changed objects, not only tracked ones. // includes all changed objects, not only tracked ones.
δZtail *zodb.ΔTail δZtail *zodb.ΔTail
byRoot map[zodb.Oid]*ΔTtail // {} root -> [] k/v change history; only for keys ∈ tracked subset vδBroots []ΔBroots // [] (rev, roots changed in this rev)
byRoot map[zodb.Oid]*ΔTtail // {} root -> [] k/v change history; only for keys ∈ tracked subset XXX -> vδByRoot ?
// handle to make connections to access database. // handle to make connections to access database.
// TODO allow client to optionally provide zconnOld/zconnNew on e.g. Update() // TODO allow client to optionally provide zconnOld/zconnNew on e.g. Update()
...@@ -127,11 +128,18 @@ type ΔTtail struct { ...@@ -127,11 +128,18 @@ type ΔTtail struct {
lastRevOf map[Key]zodb.Tid // {} key -> last lastRevOf map[Key]zodb.Tid // {} key -> last
} }
// ΔBroots represents roots-only part of ΔB - a change in BTrees space.
//
// It describes which trees were changed, but does not provide δkv details for changed trees.
type ΔBroots struct {
Rev zodb.Tid
ΔRoots SetOid // which roots changed in this revision
}
// ΔB represents a change in BTrees space. // ΔB represents a change in BTrees space.
type ΔB struct { type ΔB struct {
Rev zodb.Tid Rev zodb.Tid
ByRoot map[zodb.Oid]map[Key]ΔValue // {} root -> {}(key, δvalue) ByRoot map[zodb.Oid]map[Key]ΔValue // {} root -> {}(key, δvalue) XXX -> ΔByRoot ?
} }
// ΔTree describes changes to one BTree in one revision. // ΔTree describes changes to one BTree in one revision.
...@@ -207,7 +215,12 @@ func (δBtail *ΔBtail) Head() zodb.Tid { return δBtail.δZtail.Head() } ...@@ -207,7 +215,12 @@ func (δBtail *ΔBtail) Head() zodb.Tid { return δBtail.δZtail.Head() }
func (δBtail *ΔBtail) Tail() zodb.Tid { return δBtail.δZtail.Tail() } func (δBtail *ΔBtail) Tail() zodb.Tid { return δBtail.δZtail.Tail() }
// XXX SliceByRev? // XXX SliceByRev?
// XXX ForgetPast
// ForgetPast XXX
func (δBtail *ΔBtail) ForgetPast(revCut zodb.Tid) {
// TODO go throough vδBroots till revcut -> find which trees to trim -> trim ΔTtails.
panic("TODO")
}
// Track adds tree path to tracked set. // Track adds tree path to tracked set.
// //
......
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