Commit dc40c397 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f89b0ce2
......@@ -340,8 +340,6 @@ func (δBtail *ΔBtail) rebuild1(root zodb.Oid) error {
// - set of nodes that must be added to ΔBtail.trackSet to account for
// keys that becomes tracked. Note: this set is potentially wider compared to what was in .trackNew.
// - set of revisions for which new entries in .vδT have been created.
//
// XXX place
func (δTtail *_ΔTtail) rebuild(root zodb.Oid, δZtail *zodb.ΔTail, db *zodb.DB) (δtrackSet blib.PPTreeSubSet, δrevSet setTid, err error) {
defer xerr.Contextf(&err, "ΔTtail<%s> rebuild", root)
// XXX locking
......@@ -719,7 +717,7 @@ func (δBtail *ΔBtail) vδBroots_Update1(root zodb.Oid, rev zodb.Tid) {
func (δBtail *ΔBtail) ForgetPast(revCut zodb.Tid) {
// XXX locking
δBtail.δZtail.ForgetPast(revCut) // XXX stub
δBtail.δZtail.ForgetPast(revCut)
// go through vδBroots till revcut -> find which trees to trim -> trim ΔTtails.
......@@ -846,8 +844,6 @@ func (δBtail *ΔBtail) GetAt(root zodb.Oid, key Key, at zodb.Tid) (value Value,
// Only tracked keys are guaranteed to be present.
//
// Note: contrary to regular go slicing, low is exclusive while high is inclusive.
//
// XXX root -> *Tree ?
func (δBtail *ΔBtail) SliceByRootRev(root zodb.Oid, lo, hi zodb.Tid) /*readonly*/[]ΔTree {
xtail.AssertSlice(δBtail, lo, hi)
// XXX locking
......
......@@ -581,7 +581,8 @@ func (δftail *_ΔFileTail) forgetPast(revCut zodb.Tid) {
//
// Note: contrary to regular go slicing, low is exclusive while high is inclusive.
func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*readonly*/[]*ΔFile {
//fmt.Printf("\nslice f<%s> (@%s,@%s]\n", zfile.POid(), lo, hi)
foid := zfile.POid()
//fmt.Printf("\nslice f<%s> (@%s,@%s]\n", foid, lo, hi)
xtail.AssertSlice(δFtail, lo, hi)
// XXX locking
......@@ -603,7 +604,7 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
// δFile ────────o───────o──────x─────x────────────────────────
δftail, err := δFtail.rebuildIfNeeded(zfile.POid())
δftail, err := δFtail.rebuildIfNeeded(foid)
if err != nil {
panic(err) // XXX
}
......@@ -815,18 +816,19 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
//
// if exact=False - what is returned is only an upper bound for last block revision.
//
// zf must be any checkout from (tail, head]
// zfile must be any checkout from (tail, head]
// at must ∈ (tail, head]
// blk must be tracked
func (δFtail *ΔFtail) BlkRevAt(ctx context.Context, zf *ZBigFile, blk int64, at zodb.Tid) (_ zodb.Tid, exact bool) {
rev, exact, err := δFtail._BlkRevAt(ctx, zf, blk, at)
func (δFtail *ΔFtail) BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int64, at zodb.Tid) (_ zodb.Tid, exact bool) {
rev, exact, err := δFtail._BlkRevAt(ctx, zfile, blk, at)
if err != nil {
panic(err) // XXX
}
return rev, exact
}
func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zf *ZBigFile, blk int64, at zodb.Tid) (_ zodb.Tid, exact bool, err error) {
defer xerr.Contextf(&err, "blkrev f<%s> #%d @%s", zf.POid(), blk, at)
func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int64, at zodb.Tid) (_ zodb.Tid, exact bool, err error) {
foid := zfile.POid()
defer xerr.Contextf(&err, "blkrev f<%s> #%d @%s", foid, blk, at)
//fmt.Printf("\nblkrev #%d @%s\n", blk, at)
......@@ -837,8 +839,8 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zf *ZBigFile, blk int64,
panicf("at out of bounds: at: @%s, (tail, head] = (@%s, @%s]", at, tail, head)
}
// assert zf.at ∈ (tail, head]
zconn := zf.PJar()
// assert zfile.at ∈ (tail, head]
zconn := zfile.PJar()
zconnAt := zconn.At()
if !(tail < zconnAt && zconnAt <= head) {
panicf("zconn.at out of bounds: zconn.at: @%s, (tail, head] = (@%s, @%s]", zconnAt, tail, head)
......@@ -846,7 +848,7 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zf *ZBigFile, blk int64,
// XXX locking
δftail, err := δFtail.rebuildIfNeeded(zf.POid())
δftail, err := δFtail.rebuildIfNeeded(foid)
if err != nil {
return zodb.InvalidTid, false, err
}
......
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