From 0c13b55e55ad13056854fef5477f6de797c8f376 Mon Sep 17 00:00:00 2001 From: hofmockel Date: Sun, 12 Apr 2015 13:58:22 +0200 Subject: [PATCH] Remove rm_scan_count_limit from Cache creation. --- docs/api/options.rst | 9 ++------- docs/changelog.rst | 2 ++ rocksdb/_rocksdb.pyx | 10 ++-------- rocksdb/cache.pxd | 1 - 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/docs/api/options.rst b/docs/api/options.rst index 21fddcd..3b3ee87 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 917d76a..25df699 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 9ef4514..cd88187 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 080b99d..740101b 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)