Commit 8adc4356 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent eac5d619
......@@ -294,6 +294,7 @@ func (δBtail *ΔBtail) Tail() zodb.Tid { return δBtail.δZtail.Tail() }
// XXX path -> []oid ?
//
// XXX catch cycles on add?
/*
type TrackFlags int
const (
// TrackMaxKey
......@@ -303,7 +304,9 @@ const (
// XXX TrackMinKey (we don't need it in WCFS)
)
func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node, flags TrackFlags) error { // XXX Tree|Bucket; path[0] = root
*/
//func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node, flags TrackFlags) error { // XXX Tree|Bucket; path[0] = root
func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node) error { // XXX Tree|Bucket; path[0] = root
l := len(path)
if l == 0 {
panic("empty path")
......
......@@ -458,24 +458,15 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a
adj1 := SetKey{}
adj2 := SetKey{}
k1 := k
k2 := k
/*
if k == kInf { // XXX not needed? - kill?
k1 = maxk1
k2 = maxk2
}
*/
q1 := []Key{k1}
q2 := []Key{k2}
q1 := []Key{k}
q2 := []Key{k}
//tracef("\n")
for len(q1) > 0 || len(q2) > 0 {
//tracef("q1: %v\n", q1)
//tracef("q2: %v\n", q2)
if l1 := len(q1); l1 > 0 {
k1 = q1[l1-1]; q1 = q1[:l1-1]
k1 := q1[l1-1]; q1 = q1[:l1-1]
if !adj1.Has(k1) {
for k_ := range xkv1.Get(k1).kv {
adj1.Add(k_)
......@@ -489,7 +480,7 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a
}
if l2 := len(q2); l2 > 0 {
k2 = q2[l2-1]; q2 = q2[:l2-1]
k2 := q2[l2-1]; q2 = q2[:l2-1]
if !adj2.Has(k2) {
for k_ := range xkv2.Get(k2).kv {
adj2.Add(k_)
......@@ -571,11 +562,8 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
}); X(err)
// kInf imitates ZBigFile.Size() request, which enables maxkey tracking.
trackFlags := TrackFlags(0)
if k == kInf {
trackFlags = TrackMaxKey
}
err = δbtail.Track(k, ok, path, trackFlags); X(err)
// XXX ^^^ comment place = ?
err = δbtail.Track(k, ok, path); X(err)
kadjTracked.Update(kadj[k])
}
......
......@@ -137,12 +137,11 @@ func (δFtail *ΔFtail) Tail() zodb.Tid { return δFtail.δBtail.Tail() }
//
// A root can be associated with several files (each provided on different Track call).
func (δFtail *ΔFtail) Track(file *BigFile, blk int64, path []btree.LONode, zblk zBlk) {
δbTrackFlags := TrackFlags(0)
if blk == -1 {
// XXX blk = ∞ ?
δbTrackFlags = TrackMaxKey
// XXX blk = ∞ from beginning ?
blk = KeyMax
}
err := δFtail.δBtail.Track(blk, zblk != nil, path, δbTrackFlags)
err := δFtail.δBtail.Track(blk, zblk != nil, path)
if err != nil {
panic(err) // XXX -> error? errctx
}
......
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