Commit e3d1d90e authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 27e68642
...@@ -101,11 +101,6 @@ type ΔBtail struct { ...@@ -101,11 +101,6 @@ type ΔBtail struct {
// set of node that were requested to be tracked, but for which vδB was not yet rebuilt // set of node that were requested to be tracked, but for which vδB was not yet rebuilt
trackNew PPTreeSubSet trackNew PPTreeSubSet
// XXX kill
// // XXX root -> tracked holes
// // XXX move -> ΔTtail ?
// holeIdxByRoot map[zodb.Oid]treeSetKey
} }
...@@ -149,7 +144,6 @@ func NewΔBtail(at0 zodb.Tid, db *zodb.DB) *ΔBtail { ...@@ -149,7 +144,6 @@ func NewΔBtail(at0 zodb.Tid, db *zodb.DB) *ΔBtail {
byRoot: map[zodb.Oid]*ΔTtail{}, byRoot: map[zodb.Oid]*ΔTtail{},
trackSet: PPTreeSubSet{}, trackSet: PPTreeSubSet{},
trackNew: PPTreeSubSet{}, trackNew: PPTreeSubSet{},
// holeIdxByRoot: map[zodb.Oid]treeSetKey{},
db: db, db: db,
} }
} }
...@@ -184,16 +178,6 @@ func (orig *ΔBtail) clone() *ΔBtail { ...@@ -184,16 +178,6 @@ func (orig *ΔBtail) clone() *ΔBtail {
klon.byRoot[root] = klonΔTtail klon.byRoot[root] = klonΔTtail
} }
/* XXX kill
// holeIdxByRoot
klon.holeIdxByRoot = make(map[zodb.Oid]treeSetKey, len(orig.holeIdxByRoot))
for root, origHoleIdx := range orig.holeIdxByRoot {
klonHoleIdx := treeSetKey{make(SetKey, len(origHoleIdx.SetKey))}
klonHoleIdx.Update(origHoleIdx.SetKey)
klon.holeIdxByRoot[root] = klonHoleIdx
}
*/
return klon return klon
} }
...@@ -226,6 +210,7 @@ func (δBtail *ΔBtail) Tail() zodb.Tid { return δBtail.δZtail.Tail() } ...@@ -226,6 +210,7 @@ func (δBtail *ΔBtail) Tail() zodb.Tid { return δBtail.δZtail.Tail() }
// XXX path -> []oid ? // XXX path -> []oid ?
// //
// XXX catch cycles on add? // XXX catch cycles on add?
// XXX no need to pass keyPresent since holeIdx was removed
func (δBtail *ΔBtail) Track(key Key, keyPresent bool, nodePath []Node) error { // XXX Tree|Bucket; path[0] = root func (δBtail *ΔBtail) Track(key Key, keyPresent bool, nodePath []Node) error { // XXX Tree|Bucket; path[0] = root
path := nodePathToPath(nodePath) path := nodePathToPath(nodePath)
...@@ -243,22 +228,6 @@ func (δBtail *ΔBtail) track(key Key, keyPresent bool, path []zodb.Oid) error { ...@@ -243,22 +228,6 @@ func (δBtail *ΔBtail) track(key Key, keyPresent bool, path []zodb.Oid) error {
// track is track of path[-1] (i.e. leaf) // track is track of path[-1] (i.e. leaf)
// XXX kill
// // remember missing keys in track of leaf node (bucket or top-level ø tree)
// holeIdx := δBtail.holeIdxFor(root)
// if !keyPresent {
// holeIdx.Add(key)
// //track.holes.Add(key)
// } else {
// /*
// if track.holes.Has(key) {
// panicf("[%v] was previously requested to be tracked as ø", key)
// }
// */
// if holeIdx.Has(key) {
// panicf("[%v] was previously requested to be tracked as ø", key)
// }
// }
// XXX hack - until rebuild is implemented // XXX hack - until rebuild is implemented
if XXX_killWhenRebuildWorks { if XXX_killWhenRebuildWorks {
...@@ -273,17 +242,6 @@ if XXX_killWhenRebuildWorks { ...@@ -273,17 +242,6 @@ if XXX_killWhenRebuildWorks {
return nil return nil
} }
/* XXX kill
func (δBtail *ΔBtail) holeIdxFor(root zodb.Oid) treeSetKey {
holeIdx, ok := δBtail.holeIdxByRoot[root]
if !ok {
holeIdx = treeSetKey{SetKey{}}
δBtail.holeIdxByRoot[root] = holeIdx
}
return holeIdx
}
*/
// rebuild rebuilds ΔBtail taking trackNew requests into account. // rebuild rebuilds ΔBtail taking trackNew requests into account.
// XXX place // XXX place
func (δBtail *ΔBtail) rebuild() (err error) { func (δBtail *ΔBtail) rebuild() (err error) {
...@@ -432,7 +390,6 @@ if XXX_killWhenRebuildWorks { ...@@ -432,7 +390,6 @@ if XXX_killWhenRebuildWorks {
tracef("Update @%s -> @%s\n", δBtail.Head(), δZ.Tid) tracef("Update @%s -> @%s\n", δBtail.Head(), δZ.Tid)
tracef("δZ:\t%v\n", δZ.Changev) tracef("δZ:\t%v\n", δZ.Changev)
tracef("trackSet: %v\n", δBtail.trackSet) tracef("trackSet: %v\n", δBtail.trackSet)
// tracef("holeIdxByRoot: %v\n", δBtail.holeIdxByRoot) XXX kill
// XXX dup wrt rebuild? // XXX dup wrt rebuild?
......
...@@ -47,9 +47,6 @@ import ( ...@@ -47,9 +47,6 @@ import (
"lab.nexedi.com/nexedi/wendelin.core/wcfs/internal/xzodb" "lab.nexedi.com/nexedi/wendelin.core/wcfs/internal/xzodb"
) )
//const kInf Key = 10000 // inf key (TeX hack)
////const kInf Key = KeyMax
// XXX move infrastructure -> δbtail_treegen_test.go ? // XXX move infrastructure -> δbtail_treegen_test.go ?
// TreeGenSrv represents connection to running `treegen ...` server. // TreeGenSrv represents connection to running `treegen ...` server.
...@@ -387,7 +384,6 @@ func XGetTree(db *zodb.DB, at zodb.Tid, root zodb.Oid) RBucketSet { ...@@ -387,7 +384,6 @@ func XGetTree(db *zodb.DB, at zodb.Tid, root zodb.Oid) RBucketSet {
} }
rbucketv := RBucketSet{} rbucketv := RBucketSet{}
// xwalkDFS(ctx, -kInf, kInf, ztree, func(rb *RBucket) {
xwalkDFS(ctx, KeyMin, KeyMax, ztree, func(rb *RBucket) { xwalkDFS(ctx, KeyMin, KeyMax, ztree, func(rb *RBucket) {
rbucketv = append(rbucketv, rb) rbucketv = append(rbucketv, rb)
}) })
...@@ -1487,8 +1483,6 @@ func TestΔBTail(t *testing.T) { ...@@ -1487,8 +1483,6 @@ func TestΔBTail(t *testing.T) {
for _, k := range keyv { ks.Add(k) } for _, k := range keyv { ks.Add(k) }
return ks return ks
} }
// // oo is shorthand for kInf
// const oo = kInf
// oo is shorthand for KeyMax // oo is shorthand for KeyMax
const oo = KeyMax const oo = KeyMax
// A is shorthand for KAdjMatrix // A is shorthand for KAdjMatrix
...@@ -1972,7 +1966,6 @@ func (xkv RBucketSet) Flatten() map[Key]string { ...@@ -1972,7 +1966,6 @@ func (xkv RBucketSet) Flatten() map[Key]string {
// allTestKeys returns all keys from vt + ∞. // allTestKeys returns all keys from vt + ∞.
func allTestKeys(vt ...*tTreeCommit) SetKey { func allTestKeys(vt ...*tTreeCommit) SetKey {
// allKeys := SetKey{}; allKeys.Add(kInf) // ∞ simulating ZBigFile.Size() query
allKeys := SetKey{}; allKeys.Add(KeyMax) // ∞ simulating ZBigFile.Size() query allKeys := SetKey{}; allKeys.Add(KeyMax) // ∞ simulating ZBigFile.Size() query
for _, t := range vt { for _, t := range vt {
for _, b := range t.xkv { for _, b := range t.xkv {
......
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