17 #ifndef PAGESPEED_SYSTEM_SYSTEM_CACHE_PATH_H_
18 #define PAGESPEED_SYSTEM_SYSTEM_CACHE_PATH_H_
26 #include "pagespeed/kernel/base/thread_annotations.h"
29 namespace net_instaweb {
32 class AbstractSharedMem;
35 class FileSystemLockManager;
37 class NamedLockManager;
40 class RewriteDriverFactory;
41 class SharedMemLockManager;
43 class SystemServerContext;
44 class SystemRewriteOptions;
53 static const char kLruCache[];
78 void ChildInit(SlowWorker* cache_clean_worker);
84 void MergeConfig(
const SystemRewriteOptions* config);
99 PurgeContext* purge_context() {
return purge_context_.get(); }
102 typedef std::set<SystemServerContext*> ServerContextSet;
104 void FallBackToFileBasedLocking();
122 void MergeEntries(int64 config_value,
bool config_was_set,
125 int64* policy_value,
bool* has_explicit_policy);
129 void UpdateCachePurgeSet(
const CopyOnWrite<PurgeSet>& purge_set);
133 RewriteDriverFactory* factory_;
134 AbstractSharedMem* shm_runtime_;
135 scoped_ptr<SharedMemLockManager> shared_mem_lock_manager_;
136 scoped_ptr<FileSystemLockManager> file_system_lock_manager_;
137 NamedLockManager* lock_manager_;
138 FileCache* file_cache_backend_;
139 CacheInterface* lru_cache_;
140 CacheInterface* file_cache_;
143 bool enable_cache_purge_;
144 bool clean_interval_explicitly_set_;
145 bool clean_size_explicitly_set_;
146 bool clean_inode_limit_explicitly_set_;
148 scoped_ptr<PurgeContext> purge_context_;
150 scoped_ptr<AbstractMutex> mutex_;
151 ServerContextSet server_context_set_ GUARDED_BY(mutex_);
void AddServerContext(SystemServerContext *server_context)
Abstract interface for a cache.
Definition: cache_interface.h:32
Definition: named_lock_manager.h:82
static const char kFileCache[]
CacheStats prefixes.
Definition: system_cache_path.h:52
void MergeConfig(const SystemRewriteOptions *config)
void RootInit()
See comments in SystemCaches for calling conventions on these.
FileCache * file_cache_backend()
Definition: system_cache_path.h:73
CacheInterface * file_cache()
Per-machine file cache with any stats wrappers.
Definition: system_cache_path.h:69
Definition: system_rewrite_options.h:40
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
void GlobalCleanup(MessageHandler *handler)
only called in root process
Definition: abstract_shared_mem.h:86
void FlushCacheIfNecessary()
void RemoveServerContext(SystemServerContext *server_context)
Disassociates a server context with this CachePath – used on shutdown.
static GoogleString CachePath(SystemRewriteOptions *config)
Simple C++ implementation of file cache.
Definition: file_cache.h:42
Definition: system_cache_path.h:49
CacheInterface * lru_cache()
Per-process in-memory LRU, with any stats/thread safety wrappers, or NULL.
Definition: system_cache_path.h:66
Definition: rewrite_driver_factory.h:70