| 477 | const char* const FileCache::kAlreadyDeleted = "File already marked as deleted"; |
| 478 | |
| 479 | FileCache::FileCache(const string& cache_name, |
| 480 | Env* env, |
| 481 | int max_open_files, |
| 482 | const scoped_refptr<MetricEntity>& entity) |
| 483 | : env_(env), |
| 484 | cache_name_(cache_name), |
| 485 | eviction_cb_(new EvictionCallback()), |
| 486 | cache_(NewCache(max_open_files, cache_name)), |
| 487 | running_(1) { |
| 488 | if (entity) { |
| 489 | unique_ptr<FileCacheMetrics> metrics(new FileCacheMetrics(entity)); |
| 490 | cache_->SetMetrics(std::move(metrics), Cache::ExistingMetricsPolicy::kKeep); |
| 491 | } |
| 492 | LOG(INFO) << Substitute("Constructed file cache $0 with capacity $1", |
| 493 | cache_name, max_open_files); |
| 494 | } |
| 495 | |
| 496 | FileCache::~FileCache() { |
| 497 | running_.CountDown(); |
nothing calls this directly
no test coverage detected