MediaWiki
REL1_24
|
Bloom filter implemented using Redis. More...
Public Member Functions | |
__construct (array $config) | |
include: | |
getScopedLock ($virtualKey) | |
Get an exclusive lock on a filter for updates. | |
Protected Member Functions | |
doAdd ($key, array $members) | |
doDelete ($key) | |
doGetStatus ($virtualKey) | |
doInit ($key, $size, $precision) | |
doIsHit ($key, $member) | |
doSetStatus ($virtualKey, array $values) | |
getConnection ($to) | |
$param string $to (master/slave) | |
getSegment ($member) | |
handleException (RedisConnRef $conn, $e) | |
Protected Attributes | |
RedisLockManager | $lockMgr |
* | |
RedisConnectionPool | $redisPool |
* | |
integer | $segments = 128 |
Federate each filter into this many redis bitfield objects *. | |
array | $servers |
* |
Bloom filter implemented using Redis.
The Redis server must be >= 2.6 and should have volatile-lru or volatile-ttl if there is any eviction policy. It should not be allkeys-* in any case. Also, this can be used in a simple master/slave setup or with Redis Sentinel preferably.
Some bits are based on https://github.com/ErikDubbelboer/redis-lua-scaling-bloom-filter but are simplified to use a single filter instead of up to 32 filters.
Definition at line 34 of file BloomCacheRedis.php.
BloomCacheRedis::__construct | ( | array $ | config | ) |
include:
array | $config |
Reimplemented from BloomCache.
Definition at line 47 of file BloomCacheRedis.php.
BloomCacheRedis::doAdd | ( | $ | key, |
array $ | members | ||
) | [protected] |
string | $key | |
array | $members |
Reimplemented from BloomCache.
Definition at line 113 of file BloomCacheRedis.php.
BloomCacheRedis::doDelete | ( | $ | key | ) | [protected] |
string | $key |
Reimplemented from BloomCache.
Definition at line 291 of file BloomCacheRedis.php.
BloomCacheRedis::doGetStatus | ( | $ | key | ) | [protected] |
string | $key |
Reimplemented from BloomCache.
Definition at line 202 of file BloomCacheRedis.php.
BloomCacheRedis::doInit | ( | $ | key, |
$ | size, | ||
$ | precision | ||
) | [protected] |
string | $key | |
integer | $size | Bit length |
float | $precision |
Reimplemented from BloomCache.
Definition at line 61 of file BloomCacheRedis.php.
BloomCacheRedis::doIsHit | ( | $ | key, |
$ | member | ||
) | [protected] |
string | $key | |
string | $member |
Reimplemented from BloomCache.
Definition at line 224 of file BloomCacheRedis.php.
BloomCacheRedis::doSetStatus | ( | $ | virtualKey, |
array $ | values | ||
) | [protected] |
string | $virtualKey | |
array | $values |
Reimplemented from BloomCache.
Definition at line 186 of file BloomCacheRedis.php.
BloomCacheRedis::getConnection | ( | $ | to | ) | [protected] |
$param string $to (master/slave)
Definition at line 330 of file BloomCacheRedis.php.
BloomCacheRedis::getScopedLock | ( | $ | virtualKey | ) |
Get an exclusive lock on a filter for updates.
string | $virtualKey |
Reimplemented from BloomCache.
Definition at line 312 of file BloomCacheRedis.php.
BloomCacheRedis::getSegment | ( | $ | member | ) | [protected] |
BloomCacheRedis::handleException | ( | RedisConnRef $ | conn, |
$ | e | ||
) | [protected] |
RedisConnRef | $conn | |
Exception | $e |
Definition at line 363 of file BloomCacheRedis.php.
RedisLockManager BloomCacheRedis::$lockMgr [protected] |
*
Definition at line 36 of file BloomCacheRedis.php.
RedisConnectionPool BloomCacheRedis::$redisPool [protected] |
*
Definition at line 35 of file BloomCacheRedis.php.
integer BloomCacheRedis::$segments = 128 [protected] |
Federate each filter into this many redis bitfield objects *.
Definition at line 38 of file BloomCacheRedis.php.
*
Definition at line 37 of file BloomCacheRedis.php.