"time"
)
-var maxBlockSize = 1 << 26
-
-var concurrentWriters = 4
+var (
+ maxBlockSize = 1 << 26
+ concurrentWriters = 4 // max goroutines writing to Keep during sync()
+ writeAheadBlocks = 1 // max background jobs flushing to Keep before blocking writes
+)
// A CollectionFileSystem is a FileSystem that can be serialized as a
// manifest and stored as a collection.
// TODO: pack/flush small blocks too, when fragmented
if fn.throttle == nil {
// TODO: share a throttle with filesystem
- fn.throttle = newThrottle(concurrentWriters)
+ fn.throttle = newThrottle(writeAheadBlocks)
}
for idx, seg := range fn.segments {
seg, ok := seg.(*memSegment)
return
}
- c.Check(len(currentMemExtents()) <= concurrentWriters+1, check.Equals, true)
+ c.Check(len(currentMemExtents()) <= writeAheadBlocks+1, check.Equals, true)
f.(*filehandle).inode.(*filenode).waitPrune()
c.Check(currentMemExtents(), check.HasLen, 1)