]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/include/rocksdb/cache.h
import quincy beta 17.1.0
[ceph.git] / ceph / src / rocksdb / include / rocksdb / cache.h
index 77ddf525d0b154ed7b41969135b3a10790d174c8..e4c404333dffb53509d06b2b7c7f379a58723ecb 100644 (file)
@@ -33,6 +33,7 @@
 namespace ROCKSDB_NAMESPACE {
 
 class Cache;
+struct ConfigOptions;
 
 extern const bool kDefaultToAdaptiveMutex;
 
@@ -142,6 +143,21 @@ class Cache {
   Cache(const Cache&) = delete;
   Cache& operator=(const Cache&) = delete;
 
+  // Creates a new Cache based on the input value string and returns the result.
+  // Currently, this method can be used to create LRUCaches only
+  // @param config_options
+  // @param value  The value might be:
+  //   - an old-style cache ("1M") -- equivalent to NewLRUCache(1024*102(
+  //   - Name-value option pairs -- "capacity=1M; num_shard_bits=4;
+  //     For the LRUCache, the values are defined in LRUCacheOptions.
+  // @param result The new Cache object
+  // @return OK if the cache was sucessfully created
+  // @return NotFound if an invalid name was specified in the value
+  // @return InvalidArgument if either the options were not valid
+  static Status CreateFromString(const ConfigOptions& config_options,
+                                 const std::string& value,
+                                 std::shared_ptr<Cache>* result);
+
   // Destroys all existing entries by calling the "deleter"
   // function that was passed via the Insert() function.
   //