diff --git a/include/rocksdb/cache.h b/include/rocksdb/cache.h index 3e0e5c1cd..201d82f19 100644 --- a/include/rocksdb/cache.h +++ b/include/rocksdb/cache.h @@ -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); diff --git a/util/cache.cc b/util/cache.cc index deec52864..b9d41be49 100644 --- a/util/cache.cc +++ b/util/cache.cc @@ -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_; } };