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

.

parent c63dbe30
......@@ -66,9 +66,11 @@ type Value = zodb.Oid // XXX assumes key points to IPersistent
//
// .Track(path) - start tracking tree nodes and keys; root=path[0], keys=path[-1].keys
//
// .Update(δZ) -> δB - update BTree δ tail given raw ZODB changes
// .ForgetPast(revCut) - forget changes past revCut
// .Get(root, key, at) - get root[key] @at assuming root[key] ∈ tracked
// .Update(δZ) -> δB - update BTree δ tail given raw ZODB changes
// .ForgetPast(revCut) - forget changes past revCut
// .SliceByRev(lo, hi) -> []δB - XXX
// .SliceByRootRev(root, lo, hi) -> []δT - XXX
// .Get(root, key, at) - get root[key] @at assuming root[key] ∈ tracked
//
// An example for tracked set is a set of visited BTree paths.
// There is no requirement that tracked set belongs to only one single BTree.
......@@ -95,7 +97,7 @@ type ΔBtail struct {
// tracked index: BTree|Bucket -> top tree element.
trackIdx map[zodb.Oid]SetTree // oid -> {} roots XXX root -> oid?
// tracked objects that are not yet taken into in current δBtail
// tracked objects that are not yet taken into account in current δBtail
trackNew map[zodb.Oid]struct{} // XXX SetOid
}
......@@ -342,7 +344,15 @@ func (δBtail *ΔBtail) SliceByRev(lo, hi zodb.Tid) /*readonly*/ []ΔB {
panic("TODO")
}
// XXX
// SliceByRootRev returns history of a tree changes in (lo, hi] range.
//
// it must be called with the following condition:
//
// tail ≤ lo ≤ hi ≤ head
//
// the caller must not modify returned slice.
//
// Note: contrary to regular go slicing, low is exclusive while high is inclusive.
func (δBtail *ΔBtail) SliceByRootRev(root *Tree, lo, hi zodb.Tid) /*readonly*/[]ΔTree {
δassertSlice(δBtail, lo, hi)
......@@ -397,7 +407,7 @@ func (δBtail *ΔBtail) SliceByRootRev(root *Tree, lo, hi zodb.Tid) /*readonly*/
// . +k(blk) -> invalidate #blk (e.g. if blk was previously read as hole)
// misc
// ---- misc ----
// δassertSlice asserts that δ.tail ≤ lo ≤ hi ≤ δ.head
func δassertSlice(δ interface { Head() zodb.Tid; Tail() zodb.Tid }, lo, hi zodb.Tid) {
......
......@@ -44,8 +44,8 @@ import (
//
// ΔFtail provides the following operations:
//
// .Track(file, blkTreePath) - add file and block reached via BTree path to
// tracked set.
// .Track(file, blkTreePath) - add file and block reached via BTree path to tracked set.
//
// .Update(δZ) -> δF - update files δ tail given raw ZODB changes
// .ForgetPast(revCut) - forget changes past revCut
// .SliceByRev(lo, hi) -> []δF - query for all files changes with rev ∈ (lo, hi]
......@@ -162,12 +162,21 @@ func (δFtail *ΔFtail) SliceByRev(lo, hi zodb.Tid) /*readonly*/ []ΔF {
panic("TODO")
}
// XXX
func (δFtail *ΔFtail) SliceByFileRev(f *BigFile, lo, hi zodb.Tid) /*readonly*/[]Δfile {
// SliceByFileRev returns history of file changes in (lo, hi] range.
//
// it must be called with the following condition:
//
// tail ≤ lo ≤ hi ≤ head
//
// the caller must not modify returned slice.
//
// Note: contrary to regular go slicing, low is exclusive while high is inclusive.
func (δFtail *ΔFtail) SliceByFileRev(file *BigFile, lo, hi zodb.Tid) /*readonly*/[]Δfile {
δassertSlice(δFtail, lo, hi)
// XXX activate zfile?
vδT := δFtail.δBtail.SliceByRootRev(f.zfile.blktab, lo, hi)
vδT := δFtail.δBtail.SliceByRootRev(file.zfile.blktab, lo, hi)
//kv = kvAtTail
_ = vδT
panic("TODO")
......
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