Commit a06e0835 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6392de1d
......@@ -210,7 +210,7 @@ func (δB *ΔTail) update() {
/*
δbZ = {}
for δ in δZ:
.rootIdx[δ]:
.trackIdx[δ]:
ø -> nothing
root -> δbZ[root] += δ
......
......@@ -676,6 +676,16 @@ type ΔFTail struct {
fileIdx map[*btree.LOBTree]SetBigFile // root -> {} BigFile XXX root -> oid?
}
type ΔFentry struct {
Rev zodb.Tid
Changev []ΔFile
}
type ΔFile struct {
File *BigFile
Blkv []int64
}
func NewΔFTail(at0 zodb.Tid) *ΔFTail {
return &ΔFTail{
ΔTail: xbtree.NewΔTail(at0),
......@@ -694,6 +704,29 @@ func (δf *ΔFTail) Track(file *BigFile, path []btree.LONode) {
files.Add(file)
}
func (δf *ΔFTail) Update(δZ *zodb.EventCommit) ΔFentry {
δf.ΔTail.Update(δZ)
δB := xbtree.ΔRevEntry{} // XXX stub
var changev []ΔFile // δB.Changev root -> file (via .fileIdx)
for _, δ := range δB.Changev {
files := δf.fileIdx[δ.Root]
if len(files) == 0 {
panic(fmt.Sprintf("ΔFTail: root<%s> -> ø file", δ.Root.POid()))
}
for file := range files {
changev = append(changev, ΔFile{
File: file,
Blkv: δ.Keyv,
})
}
}
return ΔFentry{
Rev: δB.Rev,
Changev: changev,
}
}
// ---- make df happy (else it complains "function not supported") ----
......
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