diff --git a/cache/compressed_secondary_cache.cc b/cache/compressed_secondary_cache.cc index a996bab9e..d52d94c94 100644 --- a/cache/compressed_secondary_cache.cc +++ b/cache/compressed_secondary_cache.cc @@ -139,7 +139,7 @@ std::string CompressedSecondaryCache::GetPrintableOptions() const { snprintf(buffer, kBufferSize, " compression_type : %s\n", CompressionTypeToString(cache_options_.compression_type).c_str()); ret.append(buffer); - snprintf(buffer, kBufferSize, " compression_type : %d\n", + snprintf(buffer, kBufferSize, " compress_format_version : %d\n", cache_options_.compress_format_version); ret.append(buffer); return ret; diff --git a/cache/lru_cache.cc b/cache/lru_cache.cc index 147ae5bcb..b059b5a51 100644 --- a/cache/lru_cache.cc +++ b/cache/lru_cache.cc @@ -757,6 +757,17 @@ void LRUCache::WaitAll(std::vector& handles) { } } +std::string LRUCache::GetPrintableOptions() const { + std::string ret; + ret.reserve(20000); + ret.append(ShardedCache::GetPrintableOptions()); + if (secondary_cache_) { + ret.append(" secondary_cache:\n"); + ret.append(secondary_cache_->GetPrintableOptions()); + } + return ret; +} + } // namespace lru_cache std::shared_ptr NewLRUCache( diff --git a/cache/lru_cache.h b/cache/lru_cache.h index 5c1081a82..f52d7bfc6 100644 --- a/cache/lru_cache.h +++ b/cache/lru_cache.h @@ -482,6 +482,7 @@ class LRUCache virtual DeleterFn GetDeleter(Handle* handle) const override; virtual void DisownData() override; virtual void WaitAll(std::vector& handles) override; + std::string GetPrintableOptions() const override; // Retrieves number of elements in LRU, for unit test purpose only. size_t TEST_GetLRUSize();