Make Cache::GetCapacity constant

Summary: This will allow us to access constant via `DB::GetOptions().table_cache.GetCapacity()` or `DB::GetOptions().block_cache.GetCapacity()` since GetOptions() is also constant method.
main
kailiu 11 years ago
parent 3a7c5bd40a
commit c79e595471
  1. 2
      include/rocksdb/cache.h
  2. 2
      util/cache.cc

@ -102,7 +102,7 @@ class Cache {
virtual uint64_t NewId() = 0;
// returns the maximum configured capacity of the cache
virtual size_t GetCapacity() = 0;
virtual size_t GetCapacity() const = 0;
private:
void LRU_Remove(Handle* e);

@ -404,7 +404,7 @@ class ShardedLRUCache : public Cache {
MutexLock l(&id_mutex_);
return ++(last_id_);
}
virtual size_t GetCapacity() {
virtual size_t GetCapacity() const {
return capacity_;
}
};

Loading…
Cancel
Save