MediaWiki
1.32.5
|
Protected Member Functions | |
worthRefreshPopular ( $asOf, $ageNew, $timeTillRefresh, $now) | |
Check if a key is due for randomized regeneration due to its popularity. More... | |
Protected Member Functions inherited from WANObjectCache | |
determineKeyClass ( $key) | |
doGetWithSetCallback ( $key, $ttl, $callback, array $opts, &$asOf=null) | |
Do the actual I/O for getWithSetCallback() when needed. More... | |
getCurrentTime () | |
getInterimValue ( $key, $versioned, $minTime, &$asOf) | |
getProcessCache ( $group) | |
isAliveOrInGracePeriod ( $curTTL, $graceTTL) | |
Check if a key is fresh or in the grace window and thus due for randomized reuse. More... | |
isValid ( $value, $versioned, $asOf, $minTime) | |
Check whether $value is appropriately versioned and not older than $minTime (if set) More... | |
makePurgeValue ( $timestamp, $holdoff) | |
parsePurgeValue ( $value) | |
relayDelete ( $key) | |
Do the actual async bus delete of a key. More... | |
relayPurge ( $key, $ttl, $holdoff) | |
Do the actual async bus purge of a key. More... | |
setInterimValue ( $key, $wrapped, $tempTTL) | |
unwrap ( $wrapped, $now) | |
Do not use this method outside WANObjectCache. More... | |
worthRefreshExpiring ( $curTTL, $lowTTL) | |
Check if a key is nearing expiration and thus due for randomized regeneration. More... | |
wrap ( $value, $ttl, $now) | |
Do not use this method outside WANObjectCache. More... | |
Additional Inherited Members | |
Public Member Functions inherited from WANObjectCache | |
__construct (array $params) | |
adaptiveTTL ( $mtime, $maxTTL, $minTTL=30, $factor=0.2) | |
Get a TTL that is higher for objects that have not changed recently. More... | |
clearLastError () | |
Clear the "last error" registry. More... | |
clearProcessCache () | |
Clear the in-process caches; useful for testing. More... | |
delete ( $key, $ttl=self::HOLDOFF_TTL) | |
Purge a key from all datacenters. More... | |
get ( $key, &$curTTL=null, array $checkKeys=[], &$asOf=null) | |
Fetch the value of a key from cache. More... | |
getCheckKeyTime ( $key) | |
Fetch the value of a timestamp "check" key. More... | |
getLastError () | |
Get the "last error" registered; clearLastError() should be called manually. More... | |
getMulti (array $keys, &$curTTLs=[], array $checkKeys=[], array &$asOfs=[]) | |
Fetch the value of several keys from cache. More... | |
getMultiCheckKeyTime (array $keys) | |
Fetch the values of each timestamp "check" key. More... | |
getMultiWithSetCallback (ArrayIterator $keyedIds, $ttl, callable $callback, array $opts=[]) | |
Method to fetch multiple cache keys at once with regeneration. More... | |
getMultiWithUnionSetCallback (ArrayIterator $keyedIds, $ttl, callable $callback, array $opts=[]) | |
Method to fetch/regenerate multiple cache keys at once. More... | |
getQoS ( $flag) | |
getWarmupKeyMisses () | |
getWithSetCallback ( $key, $ttl, $callback, array $opts=[]) | |
Method to fetch/regenerate cache keys. More... | |
makeGlobalKey ( $class, $component=null) | |
makeKey ( $class, $component=null) | |
makeMultiKeys (array $entities, callable $keyFunc) | |
reap ( $key, $purgeTimestamp, &$isStale=false) | |
Set a key to soon expire in the local cluster if it pre-dates $purgeTimestamp. More... | |
reapCheckKey ( $key, $purgeTimestamp, &$isStale=false) | |
Set a "check" key to soon expire in the local cluster if it pre-dates $purgeTimestamp. More... | |
resetCheckKey ( $key) | |
Delete a "check" key from all datacenters, invalidating keys that use it. More... | |
set ( $key, $value, $ttl=0, array $opts=[]) | |
Set the value of a key in cache. More... | |
setLogger (LoggerInterface $logger) | |
setMockTime (&$time) | |
touchCheckKey ( $key, $holdoff=self::HOLDOFF_TTL) | |
Purge a "check" key from all datacenters, invalidating keys that use it. More... | |
useInterimHoldOffCaching ( $enabled) | |
Enable or disable the use of brief caching for tombstoned keys. More... | |
Static Public Member Functions inherited from WANObjectCache | |
static | newEmpty () |
Get an instance that wraps EmptyBagOStuff. More... | |
Public Attributes inherited from WANObjectCache | |
const | AGE_NEW = 60 |
Never consider performing "popularity" refreshes until a key reaches this age. More... | |
const | CHECK_KEY_TTL = self::TTL_YEAR |
Seconds to keep dependency purge keys around. More... | |
const | DEFAULT_PURGE_CHANNEL = 'wancache-purge' |
const | ERR_NO_RESPONSE = 1 |
const | ERR_NONE = 0 |
const | ERR_RELAY = 4 |
const | ERR_UNEXPECTED = 3 |
const | ERR_UNREACHABLE = 2 |
const | FLD_FLAGS = 4 |
const | FLD_HOLDOFF = 5 |
const | FLD_TIME = 3 |
const | FLD_TTL = 2 |
const | FLD_VALUE = 1 |
const | FLD_VERSION = 0 |
const | GRACE_TTL_NONE = 0 |
Idiom for set()/getWithSetCallback() for "no post-expired grace period". More... | |
const | HIT_RATE_HIGH = 1 |
Hits/second for a refresh to be expected within the "popularity" window. More... | |
const | HOLDOFF_NONE = 0 |
Idiom for delete() for "no hold-off". More... | |
const | HOLDOFF_TTL = 11 |
Seconds to tombstone keys on delete() More... | |
const | HOT_TTR = 900 |
The time length of the "popularity" refresh window for hot keys. More... | |
const | INTERIM_KEY_PREFIX = 'WANCache:i:' |
const | INTERIM_KEY_TTL = 1 |
Seconds to keep interim value keys for tombstoned keys around. More... | |
const | LOCK_TTL = 10 |
Seconds to keep lock keys around. More... | |
const | LOW_TTL = 30 |
Default remaining TTL at which to consider pre-emptive regeneration. More... | |
const | MAX_COMMIT_DELAY = 3 |
Max time expected to pass between delete() and DB commit finishing. More... | |
const | MAX_READ_LAG = 7 |
Max replication+snapshot lag before applying TTL_LAGGED or disallowing set() More... | |
const | MIN_TIMESTAMP_NONE = 0.0 |
Idiom for getWithSetCallback() for "no minimum required as-of timestamp". More... | |
const | MUTEX_KEY_PREFIX = 'WANCache:m:' |
const | PC_PRIMARY = 'primary:1000' |
const | PURGE_VAL_PREFIX = 'PURGED:' |
const | RAMPUP_TTL = 30 |
Seconds to ramp up to the "popularity" refresh chance after a key is no longer new. More... | |
const | STALE_TTL_NONE = 0 |
Idiom for set()/getWithSetCallback() for "do not augment the storage medium TTL". More... | |
const | TIME_KEY_PREFIX = 'WANCache:t:' |
const | TINY_NEGATIVE = -0.000001 |
Tiny negative float to use when CTL comes up >= 0 due to clock skew. More... | |
const | TSE_NONE = -1 |
Idiom for getWithSetCallback() callbacks to 'lockTSE' logic. More... | |
const | TTL_LAGGED = 30 |
Max TTL to store keys when a data sourced is lagged. More... | |
const | TTL_UNCACHEABLE = -1 |
Idiom for getWithSetCallback() callbacks to avoid calling set() More... | |
const | VALUE_KEY_PREFIX = 'WANCache:v:' |
const | VERSION = 1 |
Cache format version number. More... | |
const | VFLD_DATA = 'WOC:d' |
const | VFLD_VERSION = 'WOC:v' |
Public Attributes inherited from IExpiringStore | |
const | ATTR_EMULATION = 1 |
const | ATTR_SYNCWRITES = 2 |
const | QOS_EMULATION_SQL = 1 |
const | QOS_SYNCWRITES_BE = 2 |
const | QOS_SYNCWRITES_NONE = 1 |
const | QOS_SYNCWRITES_QC = 3 |
const | QOS_SYNCWRITES_SS = 4 |
const | QOS_UNKNOWN = INF |
const | TTL_DAY = 86400 |
const | TTL_HOUR = 3600 |
const | TTL_INDEFINITE = 0 |
const | TTL_MINUTE = 60 |
const | TTL_MONTH = 2592000 |
const | TTL_PROC_LONG = 30 |
const | TTL_PROC_SHORT = 3 |
const | TTL_SECOND = 1 |
const | TTL_WEEK = 604800 |
const | TTL_YEAR = 31536000 |
Static Protected Member Functions inherited from WANObjectCache | |
static | prefixCacheKeys (array $keys, $prefix) |
Protected Attributes inherited from WANObjectCache | |
callable null | $asyncHandler |
Function that takes a WAN cache callback and runs it later. More... | |
BagOStuff | $cache |
The local datacenter cache. More... | |
string | $cluster |
Cache cluster name for mcrouter use. More... | |
float | $epoch |
Unix timestamp of the oldest possible valid values. More... | |
int | $lastRelayError = self::ERR_NONE |
ERR_* constant for the "last error" registry. More... | |
LoggerInterface | $logger |
$mcrouterAware | |
@bar bool Whether to use mcrouter key prefixing for routing More... | |
MapCacheLRU[] | $processCaches = [] |
Map of group PHP instance caches. More... | |
string | $purgeChannel |
Purge channel name. More... | |
EventRelayer | $purgeRelayer |
Bus that handles purge broadcasts. More... | |
string | $region |
Physical region for mcrouter use. More... | |
StatsdDataFactoryInterface | $stats |
bool | $useInterimHoldOffCaching = true |
Whether to use "interim" caching while keys are tombstoned. More... | |
Definition at line 1745 of file WANObjectCacheTest.php.
|
protected |
Check if a key is due for randomized regeneration due to its popularity.
This is used so that popular keys can preemptively refresh themselves for higher consistency (especially in the case of purge loss/delay). Unpopular keys can remain in cache with their high nominal TTL. This means popular keys keep good consistency, whether the data changes frequently or not, and long-tail keys get to stay in cache and get hits too. Similar to worthRefreshExpiring(), randomization is used.
float | $asOf | UNIX timestamp of the value |
int | $ageNew | Age of key when this might recommend refreshing (seconds) |
int | $timeTillRefresh | Age of key when it should be refreshed if popular (seconds) |
float | $now | The current UNIX timestamp |
Reimplemented from WANObjectCache.
Definition at line 1746 of file WANObjectCacheTest.php.