Commit 4ec86803 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 108235f0
......@@ -94,59 +94,23 @@ type ΔFile struct {
}
// XXX doc
/*
// bindFile associates ZBlk as being used by file to store block #blk.
//
// A ZBlk may be bound to several blocks inside one file, and to
// several files.
//
// The information is preserved even when ZBlk comes to ghost
// state, but is lost if ZBlk is garbage collected.
//
// it is safe to call multiple bindFile simultaneously.
// it is not safe to call bindFile and boundTo simultaneously.
//
// XXX link to overview.
bindFile(file *BigFile, blk int64)
// XXX unbindFile
// XXX zfile -> bind map for it
// blkBoundTo returns ZBlk association with file(s)/#blk(s).
//
// The association returned is that was previously set by bindFile.
//
// blkBoundTo must not be called simultaneously wrt bindFile.
blkBoundTo() map[*BigFile]SetI64
*/
// XXX -> _IInΔFtail ?
type _ZBlkInΔFtail interface {
// inΔFtail returns pointer to struct zblkInΔFtail embedded into this ZBlk.
//
// this structure is volatile in-RAM only and is used to track
// ZBlk->File|parent(XXX) relation for data blocks loaded with this ZBlk.
//
// XXX data stored by zBlkBase is transient - it is _not_ included into persistent state
inΔFtail() *zblkInΔFtail
}
// zblkInΔFtail is part of ΔFtail embedded into ZBlk*.
// zblkInΔFtail is ΔFtail-related volatile data embedded into ZBlk*.
//
// The data stored by zblkInΔFtail is transient - it is _not_ included into
// The data is preserved even when ZBlk comes to ghost state, but is lost if
// ZBlk is garbage collected. The data is transient - it is _not_ included into
// persistent state.
type zblkInΔFtail struct {
mu sync.Mutex // used only for binding to support multiple loaders
mu sync.Mutex // to support multiple concurrent loaders
// XXX change vvv to intree_parent? {} Bucket -> set(#blk)
// (this is uniform with building in-RAM reverse child->parents relation for
// tree nodes and for tree_root->file)
// with which files/blocks this ZBlk is associated with as of @head state
infile map[*BigFile]SetI64 // {} file -> set(#blk)
infile map[*BigFile]SetI64 // {} file -> set(#blk)
}
type _ZBlkInΔFtail interface { inΔFtail() *zblkInΔFtail }
func (z *zblkInΔFtail) inΔFtail() *zblkInΔFtail { return z }
// NewΔFtail creates new ΔFtail object.
......
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