Class for tracking per-entity dependency path lists that are expensive to mass compute.
More...
|
| newEntityDependencies (array $paths=[], $asOf=null) |
|
| remove ( $type, $entities) |
| Delete the currently tracked dependencies for an entity or set of entities.
|
|
| renew ( $type, $entities, $ttl) |
| Set the expiry for the currently tracked dependencies for an entity or set of entities.
|
|
| retrieve ( $type, $entity) |
| Get the currently tracked dependencies for an entity.
|
|
| retrieveMulti ( $type, array $entities) |
| Get the currently tracked dependencies for a set of entities.
|
|
| store ( $type, $entity, array $data, $ttl) |
| Set the currently tracked dependencies for an entity.
|
|
| storeMulti ( $type, array $dataByEntity, $ttl) |
| Set the currently tracked dependencies for a set of entities.
|
|
Class for tracking per-entity dependency path lists that are expensive to mass compute.
Definition at line 28 of file DependencyStore.php.
◆ newEntityDependencies()
Wikimedia\DependencyStore\DependencyStore::newEntityDependencies |
( |
array |
$paths = [] , |
|
|
|
$asOf = null |
|
) |
| |
◆ remove()
Wikimedia\DependencyStore\DependencyStore::remove |
( |
|
$type, |
|
|
|
$entities |
|
) |
| |
|
abstract |
◆ renew()
Wikimedia\DependencyStore\DependencyStore::renew |
( |
|
$type, |
|
|
|
$entities, |
|
|
|
$ttl |
|
) |
| |
|
abstract |
◆ retrieve()
Wikimedia\DependencyStore\DependencyStore::retrieve |
( |
|
$type, |
|
|
|
$entity |
|
) |
| |
|
final |
Get the currently tracked dependencies for an entity.
The "paths" field contains a sorted list of unique paths
The "asOf" field reflects the last-modified timestamp of the dependency data itself. It will be null if there is no tracking data available. Note that if empty path lists are never stored (as an optimisation) then it will not be possible to discern whether the result is up-to-date.
- Parameters
-
string | $type | Entity type |
string | $entity | Entity name |
- Returns
- array Map of (paths: paths, asOf: UNIX timestamp or null)
- Exceptions
-
Definition at line 58 of file DependencyStore.php.
References $type, and Wikimedia\DependencyStore\DependencyStore\retrieveMulti().
◆ retrieveMulti()
Wikimedia\DependencyStore\DependencyStore::retrieveMulti |
( |
|
$type, |
|
|
array |
$entities |
|
) |
| |
|
abstract |
◆ store()
Wikimedia\DependencyStore\DependencyStore::store |
( |
|
$type, |
|
|
|
$entity, |
|
|
array |
$data, |
|
|
|
$ttl |
|
) |
| |
|
final |
Set the currently tracked dependencies for an entity.
Dependency data should be set to persist as long as anything might rely on it existing in order to check the validity of some previously computed work. This can be achieved while minimizing storage space under the following scheme:
- a) computed work has a TTL (time-to-live)
- b) when work is computed, the dependency data is updated
- c) the dependency data has a TTL higher enough to accounts for skew/latency
- d) the TTL of tracked dependency data is renewed upon access
- Parameters
-
string | $type | Entity type |
string | $entity | Entity name |
array | $data | Map of (paths: paths, asOf: UNIX timestamp or null) |
int | $ttl | New time-to-live in seconds |
- Exceptions
-
Definition at line 91 of file DependencyStore.php.
References $type, and Wikimedia\DependencyStore\DependencyStore\storeMulti().
◆ storeMulti()
Wikimedia\DependencyStore\DependencyStore::storeMulti |
( |
|
$type, |
|
|
array |
$dataByEntity, |
|
|
|
$ttl |
|
) |
| |
|
abstract |
The documentation for this class was generated from the following file: