Commit 096d7eb0 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a4b30e86
......@@ -475,45 +475,8 @@ type Head struct {
// head/watch opens
// XXX protected by ... head.zconnMu ?
watchTab map[*Watcher]struct{}
}
// /head/watch - served by Watch.
type Watch struct {
fsNode
head *Head // parent head/
idNext int32 // ID for next opened Watcher
}
// /head/watch handle - served by Watcher.
type Watcher struct {
sk *FileSock // IO channel to client
id int32 // ID of this /head/watch handle (for debug log)
head *Head
// established file watchers.
// XXX in-progress - where? -> nowhere; here only established watches are added
// XXX locking?
// XXX -> {} foid -> FileWatch
fileTab map[*FileWatch]struct{}
// IO
// acceptq chan string // (stream, msg) // client-initiated messages go here
rxMu sync.Mutex
rxTab map[uint64]chan string // client replies go via here
}
// FileWatch represents watching for 1 BigFile.
// XXX merge into watcher?
type FileWatch struct {
link *Watcher // link to client
file *BigFile // XXX needed?
// XXX locking
at zodb.Tid // requested to be watched @at
pinned SetI64 // blocks that are already pinned to be ≤ at
// XXX -> watchTab?
wlinkTab map[*WatchLink]struct{}
}
// /(head|<rev>)/bigfile/ - served by BigFileDir.
......@@ -560,10 +523,10 @@ type BigFile struct {
loadMu sync.Mutex
loading map[int64]*blkLoadState // #blk -> {... blkdata}
// watchers attached to this file
// watches attached to this file
// XXX already in "established" state (i.e. initial watch request was answered with "ok")
// XXX locking -> watchMu?
watchers map[*FileWatch]struct{}
watches map[*Watch]struct{}
}
// blkLoadState represents a ZBlk load state/result.
......@@ -577,6 +540,42 @@ type blkLoadState struct {
err error
}
// /head/watch - represented by WatchNode.
type WatchNode struct {
fsNode
head *Head // parent head/
idNext int32 // ID for next opened WatchLink
}
// /head/watch handle - represented by WatchLink.
type WatchLink struct {
sk *FileSock // IO channel to client
id int32 // ID of this /head/watch handle (for debug log)
head *Head
// established watchs.
// XXX in-progress - where? -> nowhere; here only established watches are added
// XXX locking?
watchTab map[zodb.Oid]*Watch // {} foid -> Watch
// IO
// acceptq chan string // (stream, msg) // client-initiated messages go here
rxMu sync.Mutex
rxTab map[uint64]chan string // client replies go via here
}
// Watch represents watching for changes to 1 BigFile.
type Watch struct {
wlink *WatchLink // link to client
file *BigFile // XXX needed?
// XXX locking
at zodb.Tid // requested to be watched @at
pinned SetI64 // blocks that are already pinned to be ≤ at
}
// -------- 3) Cache invariant --------
// zodbCacheControl implements zodb.LiveCacheControl to tune ZODB to never evict
......
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