virtual int eviction(const DoutPrefixProvider* dpp, uint64_t size, optional_yield y) = 0;
virtual void update(const DoutPrefixProvider* dpp, std::string& key, uint64_t offset, uint64_t len, std::string version, optional_yield y) = 0;
virtual bool erase(const DoutPrefixProvider* dpp, const std::string& key, optional_yield y) = 0;
- virtual void shutdown() = 0;
};
class LFUDAPolicy : public CachePolicy {
virtual int eviction(const DoutPrefixProvider* dpp, uint64_t size, optional_yield y) override;
virtual void update(const DoutPrefixProvider* dpp, std::string& key, uint64_t offset, uint64_t len, std::string version, optional_yield y) override;
virtual bool erase(const DoutPrefixProvider* dpp, const std::string& key, optional_yield y) override;
- virtual void shutdown() override;
void set_local_weight(std::string& key, int localWeight);
LFUDAEntry* find_entry(std::string key) {
return nullptr;
return it->second;
}
+ void shutdown();
};
class LRUPolicy : public CachePolicy {
virtual int eviction(const DoutPrefixProvider* dpp, uint64_t size, optional_yield y) override;
virtual void update(const DoutPrefixProvider* dpp, std::string& key, uint64_t offset, uint64_t len, std::string version, optional_yield y) override;
virtual bool erase(const DoutPrefixProvider* dpp, const std::string& key, optional_yield y) override;
- virtual void shutdown() override {}
};
class PolicyDriver {
dir->shutdown();
cacheDriver->shutdown();
- policyDriver->get_cache_policy()->shutdown();
+ dynamic_cast<rgw::d4n::LFUDAPolicy*>(policyDriver->get_cache_policy())->shutdown();
boost::system::error_code ec;
request req;
dir->shutdown();
cacheDriver->shutdown();
- policyDriver->get_cache_policy()->shutdown();
+ dynamic_cast<rgw::d4n::LFUDAPolicy*>(policyDriver->get_cache_policy())->shutdown();
std::string key = block->cacheObj.bucketName + "_" + block->cacheObj.objName + "_" + std::to_string(block->blockID) + "_" + std::to_string(block->size);
boost::system::error_code ec;
dir->shutdown();
cacheDriver->shutdown();
- policyDriver->get_cache_policy()->shutdown();
+ dynamic_cast<rgw::d4n::LFUDAPolicy*>(policyDriver->get_cache_policy())->shutdown();
boost::system::error_code ec;
request req;