Commit ac195099 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 3f3e0d87
...@@ -57,7 +57,9 @@ type setOid = set.Oid ...@@ -57,7 +57,9 @@ type setOid = set.Oid
// be present. In particular a block that was not explicitly requested to be // be present. In particular a block that was not explicitly requested to be
// tracked, even if it was changed in δZ, is not guaranteed to be present in δF. // tracked, even if it was changed in δZ, is not guaranteed to be present in δF.
// //
// XXX after epoch previous track requests has no effects // After file epoch (file creation, deletion, or any other change to file
// object) previous track requests for that file become forgotten and has no
// further effect.
// //
// ΔFtail provides the following operations: // ΔFtail provides the following operations:
// //
...@@ -97,13 +99,13 @@ type _ΔFileTail struct { ...@@ -97,13 +99,13 @@ type _ΔFileTail struct {
vδE []_ΔFileEpoch // changes to ZBigFile object itself ; nil if not yet rebuilt vδE []_ΔFileEpoch // changes to ZBigFile object itself ; nil if not yet rebuilt
} }
// _ΔFileEpoch represent change to ZBigFile object. // _ΔFileEpoch represent a change to ZBigFile object.
type _ΔFileEpoch struct { type _ΔFileEpoch struct {
Rev zodb.Tid Rev zodb.Tid
oldRoot zodb.Oid // .blktab was pointing to oldRoot before ; VDEL if ZBigFile deleted oldRoot zodb.Oid // .blktab was pointing to oldRoot before ; VDEL if ZBigFile deleted
newRoot zodb.Oid // .blktab was changed to point to newRoot ; ----//---- newRoot zodb.Oid // .blktab was changed to point to newRoot ; ----//----
newBlkSize int64 // .blksize was changed to newBlkSize ; -1 if ZBigFile deleted oldBlkSize int64 // .blksize was oldBlkSize ; -1 if ZBigFile deleted
// XXX +oldBlkSize ? newBlkSize int64 // .blksize was changed to newBlkSize ; ----//----
// snapshot of trackSetZBlk for this file right before this epoch // snapshot of trackSetZBlk for this file right before this epoch
oldTrackSetZBlk map[zodb.Oid]setI64 // {} zblk -> {}blk oldTrackSetZBlk map[zodb.Oid]setI64 // {} zblk -> {}blk
...@@ -299,6 +301,7 @@ func (δftail *_ΔFileTail) rebuild1(foid zodb.Oid, δZtail *zodb.ΔTail, db *zo ...@@ -299,6 +301,7 @@ func (δftail *_ΔFileTail) rebuild1(foid zodb.Oid, δZtail *zodb.ΔTail, db *zo
Rev: δZ.Rev, Rev: δZ.Rev,
oldRoot: δ.blktabOld, oldRoot: δ.blktabOld,
newRoot: δ.blktabNew, newRoot: δ.blktabNew,
oldBlkSize: δ.blksizeOld,
newBlkSize: δ.blksizeNew, newBlkSize: δ.blksizeNew,
oldTrackSetZBlk: nil, // nothing was tracked oldTrackSetZBlk: nil, // nothing was tracked
} }
...@@ -364,6 +367,7 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) { ...@@ -364,6 +367,7 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) {
Rev: δZ.Tid, Rev: δZ.Tid,
oldRoot: δ.blktabOld, oldRoot: δ.blktabOld,
newRoot: δ.blktabNew, newRoot: δ.blktabNew,
oldBlkSize: δ.blksizeOld,
newBlkSize: δ.blksizeNew, newBlkSize: δ.blksizeNew,
oldTrackSetZBlk: map[zodb.Oid]setI64{}, oldTrackSetZBlk: map[zodb.Oid]setI64{},
} }
......
...@@ -245,6 +245,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -245,6 +245,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
Rev: t1.At, Rev: t1.At,
oldRoot: zodb.InvalidOid, oldRoot: zodb.InvalidOid,
newRoot: t.Root(), newRoot: t.Root(),
oldBlkSize: -1,
newBlkSize: blksize, newBlkSize: blksize,
oldTrackSetZBlk: nil, oldTrackSetZBlk: nil,
}) })
...@@ -414,13 +415,13 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -414,13 +415,13 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
if delfile { if delfile {
δE.oldRoot = t.Root() δE.oldRoot = t.Root()
δE.newRoot = zodb.InvalidOid δE.newRoot = zodb.InvalidOid
δE.oldBlkSize = blksize
δE.newBlkSize = -1 δE.newBlkSize = -1
// XXX oldBlkSize ?
} else { } else {
δE.oldRoot = zodb.InvalidOid δE.oldRoot = zodb.InvalidOid
δE.newRoot = t.Root() δE.newRoot = t.Root()
δE.oldBlkSize = -1
δE.newBlkSize = blksize δE.newBlkSize = blksize
// XXX oldBlkSize ?
} }
oldTrackSetZBlk := map[zodb.Oid]setI64{} oldTrackSetZBlk := map[zodb.Oid]setI64{}
for zblk, inblk := range ZinblkPrev { for zblk, inblk := range ZinblkPrev {
......
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