Trees | Indices | Help |
---|
|
extern.log.log.Loggable --+ | plugs.base.Plug --+ | plugs.base.ComponentPlug --+ | fileprovider.FileProviderPlug --+ | extern.log.log.Loggable --+ | FileProviderLocalCachedPlug
WARNING: Currently does not work properly in combination with rate-control.
I'm caching the files taken from a mounted network file system to a shared local directory. Multiple instances can share the same cache directory, but it's recommended to use slightly different values for the property cleanup-high-watermark. I'm using the directory access time to know when the cache usage changed and keep an estimation of the cache usage for statistics.
I'm creating a unique thread to do the file copying block by block, for all files to be copied to the cache. Using a thread instead of a reactor.callLater 'loop' allow for higher copy throughput and do not slow down the mail loop when lots of files are copied at the same time. Simulations with real request logs show that using a thread gives better results than the equivalent asynchronous implementation.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
FilePath |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
tuple |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
|
|||
logCategory =
Implementors can provide a category to log their messages under. |
|||
Inherited from |
|
|
|
|
Start updating statistics.
|
Stop updating statistics.
|
|
Returns a log name for a path, shortened to a maximum size specified by the global variable MAX_LOGNAME_SIZE. The log name will be the filename part of the path postfixed by the id in brackets if id is not None. |
Returns an identifier for a path. The identifier is a digest of the path encoded in hex string. The hash function used is SHA1. It caches the identifiers in a dictionary indexed by path and with a maximum number of entry specified by the constant ID_CACHE_MAX_SIZE. |
|
Try to reserve cache space. If there is not enough space and the cache cleanup is enabled, it will delete files from the cache starting with the ones with oldest access time until the cache usage drops below the fraction specified by the property cleanup-low-threshold. Returns a 'tag' that should be used to 'free' the cache space using releaseCacheSpace. This tag is needed to better estimate the cache usage, if the cache usage has been updated since cache space has been allocated, freeing up the space should not change the cache usage estimation.
|
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Wed Aug 11 21:33:39 2010 | http://epydoc.sourceforge.net |