persistent_cache_options.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
  2. // This source code is licensed under both the GPLv2 (found in the
  3. // COPYING file in the root directory) and Apache 2.0 License
  4. // (found in the LICENSE.Apache file in the root directory).
  5. #pragma once
  6. #include <string>
  7. #include "monitoring/statistics.h"
  8. #include "rocksdb/persistent_cache.h"
  9. namespace ROCKSDB_NAMESPACE {
  10. // PersistentCacheOptions
  11. //
  12. // This describe the caching behavior for page cache
  13. // This is used to pass the context for caching and the cache handle
  14. struct PersistentCacheOptions {
  15. PersistentCacheOptions() {}
  16. explicit PersistentCacheOptions(
  17. const std::shared_ptr<PersistentCache>& _persistent_cache,
  18. const std::string _key_prefix, Statistics* const _statistics)
  19. : persistent_cache(_persistent_cache),
  20. key_prefix(_key_prefix),
  21. statistics(_statistics) {}
  22. virtual ~PersistentCacheOptions() {}
  23. std::shared_ptr<PersistentCache> persistent_cache;
  24. std::string key_prefix;
  25. Statistics* statistics = nullptr;
  26. };
  27. } // namespace ROCKSDB_NAMESPACE