diff --git a/docs/api/options.rst b/docs/api/options.rst index 21fddcd4845414f0dfa611869e05b910b9adb3e9..3b3ee876ded54472e90580620901ce96f5b7c016 100644 --- a/docs/api/options.rst +++ b/docs/api/options.rst @@ -761,16 +761,11 @@ LRUCache Wraps the rocksdb LRUCache - .. py:method:: __init__(capacity, shard_bits=None, rm_scan_count_limit=None) + .. py:method:: __init__(capacity, shard_bits=None) Create a new cache with a fixed size capacity. The cache is sharded to 2^numShardBits shards, by hash of the key. The total capacity - is divided and evenly assigned to each shard. Inside each shard, - the eviction is done in two passes: first try to free spaces by - evicting entries that are among the most least used removeScanCountLimit - entries and do not have reference other than by the cache itself, in - the least-used order. If not enough space is freed, further free the - entries in least used order. + is divided and evenly assigned to each shard. .. _table_factories_label: diff --git a/docs/changelog.rst b/docs/changelog.rst index 917d76a0cc05cc090f4cf16cffcd107dbf7010c4..25df699220676f19d467ca6668df5667d08e6b2d 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -49,6 +49,8 @@ In newer versions of rocksdb a bunch of options were moved or removed. * Moved ``Options.block_restart_interval`` to ``BlockBasedTableFactory`` * Moved ``Options.whole_key_filtering`` to ``BlockBasedTableFactory`` * Removed ``Options.table_cache_remove_scan_count_limit`` +* Removed rm_scan_count_limit from ``LRUCache`` + New: ^^^^ diff --git a/rocksdb/_rocksdb.pyx b/rocksdb/_rocksdb.pyx index 9ef4514825e67fb67f187ce632e1750c1455958a..cd88187815381082aa93a724430fed6e88794d7d 100644 --- a/rocksdb/_rocksdb.pyx +++ b/rocksdb/_rocksdb.pyx @@ -442,15 +442,9 @@ cdef class PyCache(object): cdef class PyLRUCache(PyCache): cdef shared_ptr[cache.Cache] cache_ob - def __cinit__(self, capacity, shard_bits=None, rm_scan_count_limit=None): + def __cinit__(self, capacity, shard_bits=None): if shard_bits is not None: - if rm_scan_count_limit is not None: - self.cache_ob = cache.NewLRUCache( - capacity, - shard_bits, - rm_scan_count_limit) - else: - self.cache_ob = cache.NewLRUCache(capacity, shard_bits) + self.cache_ob = cache.NewLRUCache(capacity, shard_bits) else: self.cache_ob = cache.NewLRUCache(capacity) diff --git a/rocksdb/cache.pxd b/rocksdb/cache.pxd index 080b99dd5bf099c653ee122e22145791c160525f..740101b4b47ea7c27697ec13b3badb90623914cc 100644 --- a/rocksdb/cache.pxd +++ b/rocksdb/cache.pxd @@ -6,4 +6,3 @@ cdef extern from "rocksdb/cache.h" namespace "rocksdb": cdef extern shared_ptr[Cache] NewLRUCache(size_t) cdef extern shared_ptr[Cache] NewLRUCache(size_t, int) - cdef extern shared_ptr[Cache] NewLRUCache(size_t, int, int)