Commit 2a8b0802 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 16571605
...@@ -330,9 +330,10 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) { ...@@ -330,9 +330,10 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) {
δfile.Blocks = nil δfile.Blocks = nil
δfile.Size = false δfile.Size = false
// XXX + rebuild XXX not here - in track(new file)
_ = δ _ = δ
//fmt.Printf("δZBigFile: %v\n", δ) //fmt.Printf("δZBigFile: %v\n", δ)
//return ΔF{}, fmt.Errorf("ZBigFile<%s> changed @%s", oid, δZ.Tid)
} }
// fmt.Printf("-> δF: %v\n", δF) // fmt.Printf("-> δF: %v\n", δF)
...@@ -538,7 +539,7 @@ func (δFtail *ΔFtail) LastBlkRev(ctx context.Context, zf *ZBigFile, blk int64, ...@@ -538,7 +539,7 @@ func (δFtail *ΔFtail) LastBlkRev(ctx context.Context, zf *ZBigFile, blk int64,
// ---------------------------------------- // ----------------------------------------
// zfilediff ... XXX // zfilediff returns direct difference for ZBigFile<foid> old..new .
type _ΔZBigFile struct { type _ΔZBigFile struct {
blksizeOld, blksizeNew int64 blksizeOld, blksizeNew int64
blktabOld, blktabNew zodb.Oid blktabOld, blktabNew zodb.Oid
...@@ -565,7 +566,7 @@ func zfilediff(db *zodb.DB, foid zodb.Oid, old, new zodb.Tid) (δ *_ΔZBigFile, ...@@ -565,7 +566,7 @@ func zfilediff(db *zodb.DB, foid zodb.Oid, old, new zodb.Tid) (δ *_ΔZBigFile,
return diffF(ctx, a, b) return diffF(ctx, a, b)
} }
// diffF computes direct difference in between two ZBigFile objects. // diffF returns direct difference in between two ZBigFile objects.
func diffF(ctx context.Context, a, b *ZBigFile) (δ *_ΔZBigFile, err error) { func diffF(ctx context.Context, a, b *ZBigFile) (δ *_ΔZBigFile, err error) {
defer xerr.Contextf(&err, "diffF %s %s", xzodb.XidOf(a), xzodb.XidOf(b)) defer xerr.Contextf(&err, "diffF %s %s", xzodb.XidOf(a), xzodb.XidOf(b))
......
...@@ -256,9 +256,8 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -256,9 +256,8 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
if epoch { if epoch {
blkTab = map[int64]string{} blkTab = map[int64]string{}
Zinblk = map[string]setI64{} Zinblk = map[string]setI64{}
} δblk = nil
} else {
// XXX else?
// rebuild blkTab/Zinblk // rebuild blkTab/Zinblk
for blk, zblk := range test.δblkTab { for blk, zblk := range test.δblkTab {
zprev, ok := blkTab[blk] zprev, ok := blkTab[blk]
...@@ -301,6 +300,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -301,6 +300,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
δblk.Add(blk) δblk.Add(blk)
} }
} }
}
// commit updated zfile / blkTab + dataTab // commit updated zfile / blkTab + dataTab
var req string var req string
...@@ -337,10 +337,10 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -337,10 +337,10 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
err = zconn.Resync(ctx, commit.At); X(err) err = zconn.Resync(ctx, commit.At); X(err)
var δfok *ΔFile var δfok *ΔFile
if len(δblk) != 0 { if epoch || len(δblk) != 0 {
δfok = &ΔFile{ δfok = &ΔFile{
Rev: commit.At, Rev: commit.At,
Epoch: epoch, // XXX epoch -> blocks/size = nil ? Epoch: epoch,
Blocks: δblk, Blocks: δblk,
Size: δtree, // not strictly ok, but matches current ΔFtail code Size: δtree, // not strictly ok, but matches current ΔFtail code
} }
......
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