Signed-off-by: Dehao Shang <dehao.shang@intel.com>
Option("immutable_object_cache_watermark", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
.set_default(0.1)
.set_description("immutable object cache water mark"),
+
+ Option("immutable_object_cache_dir_num", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+ .set_default(10)
+ .set_description("immutable object cache dir number"),
});
}
m_cache_watermark =
m_cct->_conf.get_val<double>("immutable_object_cache_watermark");
+ m_dir_num =
+ m_cct->_conf.get_val<uint64_t>("immutable_object_cache_dir_num");
+
if (m_cache_root_dir.back() != '/') {
m_cache_root_dir += "/";
}
for (auto& obj : obj_list) {
do_evict(obj);
}
+ return 0;
}
int ObjectCacheStore::do_evict(std::string cache_file) {
std::map<uint64_t, librados::IoCtx> m_ioctx_map;
Mutex m_ioctx_map_lock;
Policy* m_policy;
- // TODO(dehao): make this configurable
- int m_dir_num = 10;
+ uint64_t m_dir_num;
uint64_t m_object_cache_max_size;
float m_cache_watermark;
std::string m_cache_root_dir;