Commit 7fbd0360 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent e2b4ee4b
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
package zdata package zdata
// XXX note about ΔFtail organization: queries results are built on the fly to
// avoid complexity of recomputing vδF on tracking set change.
import ( import (
"context" "context"
"fmt" "fmt"
...@@ -78,8 +81,8 @@ type setOid = set.Oid ...@@ -78,8 +81,8 @@ type setOid = set.Oid
type ΔFtail struct { type ΔFtail struct {
// ΔFtail merges ΔBtail with history of ZBlk // ΔFtail merges ΔBtail with history of ZBlk
δBtail *xbtree.ΔBtail δBtail *xbtree.ΔBtail
fileIdx map[zodb.Oid]setOid // tree-root -> {} ZBigFile<oid> as of @head fileIdx map[zodb.Oid]setOid // tree-root -> {} ZBigFile<oid> as of @head
rootIdx map[zodb.Oid]zodb.Oid // file -> tree-root rootIdx map[zodb.Oid]zodb.Oid // file -> tree-root as of @head
trackSetZFile setOid // set of tracked ZBigFiles as of @head trackSetZFile setOid // set of tracked ZBigFiles as of @head
trackSetZBlk map[zodb.Oid]*zblkTrack // zblk -> {} root -> {}blk as of @head trackSetZBlk map[zodb.Oid]*zblkTrack // zblk -> {} root -> {}blk as of @head
...@@ -104,10 +107,6 @@ type ΔFile struct { ...@@ -104,10 +107,6 @@ type ΔFile struct {
Size bool // whether file size changed XXX -> ΔSize? Size bool // whether file size changed XXX -> ΔSize?
} }
// XXX note about ΔFtail organization: queries results are built on the fly to
// avoid complexity of recomputing vδF on tracking set change.
// NewΔFtail creates new ΔFtail object. // NewΔFtail creates new ΔFtail object.
// //
// Initial tracked set is empty. // Initial tracked set is empty.
...@@ -334,6 +333,10 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) { ...@@ -334,6 +333,10 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) {
_ = δ _ = δ
//fmt.Printf("δZBigFile: %v\n", δ) //fmt.Printf("δZBigFile: %v\n", δ)
// XXX update .fileIdx
// XXX update .rootIdx
// XXX update .trackSetZBlk ?
} }
// fmt.Printf("-> δF: %v\n", δF) // fmt.Printf("-> δF: %v\n", δF)
......
...@@ -222,6 +222,9 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -222,6 +222,9 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
// δfstr/vδfstr converts δf/vδf to string taking xat into account // δfstr/vδfstr converts δf/vδf to string taking xat into account
δfstr := func(δf *ΔFile) string { δfstr := func(δf *ΔFile) string {
s := fmt.Sprintf("@%s·%s", xat[δf.Rev], δf.Blocks) s := fmt.Sprintf("@%s·%s", xat[δf.Rev], δf.Blocks)
if δf.Epoch {
s += "E"
}
if δf.Size { if δf.Size {
s += "S" s += "S"
} }
......
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