MediaWiki  master
Wikimedia\DependencyStore\KeyValueDependencyStore Class Reference

Lightweight class for tracking path dependencies lists via an object cache instance. More...

Inheritance diagram for Wikimedia\DependencyStore\KeyValueDependencyStore:
Collaboration diagram for Wikimedia\DependencyStore\KeyValueDependencyStore:

Public Member Functions

 __construct (BagOStuff $stash)
 
 remove ( $type, $entities)
 Delete the currently tracked dependencies for an entity or set of entities. More...
 
 renew ( $type, $entities, $ttl)
 Set the expiry for the currently tracked dependencies for an entity or set of entities. More...
 
 retrieveMulti ( $type, array $entities)
 Get the currently tracked dependencies for a set of entities. More...
 
 storeMulti ( $type, array $dataByEntity, $ttl)
 Set the currently tracked dependencies for a set of entities. More...
 
- Public Member Functions inherited from Wikimedia\DependencyStore\DependencyStore
 newEntityDependencies (array $paths=[], $asOf=null)
 
 retrieve ( $type, $entity)
 Get the currently tracked dependencies for an entity. More...
 
 store ( $type, $entity, array $data, $ttl)
 Set the currently tracked dependencies for an entity. More...
 

Private Member Functions

 getStoreKey ( $type, $entity)
 

Private Attributes

BagOStuff $stash
 

Detailed Description

Lightweight class for tracking path dependencies lists via an object cache instance.

This does not throw DependencyStoreException due to I/O errors since it is optimized for speed and availability. Read methods return empty placeholders on failure. Write methods might issue I/O in the background and return immediately. However, reads methods will at least block on the resolution (success/failure) of any such pending writes.

Since
1.35

Definition at line 36 of file KeyValueDependencyStore.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\DependencyStore\KeyValueDependencyStore::__construct ( BagOStuff  $stash)
Parameters
BagOStuff$stashStorage backend

Definition at line 43 of file KeyValueDependencyStore.php.

References Wikimedia\DependencyStore\KeyValueDependencyStore\$stash.

Member Function Documentation

◆ getStoreKey()

Wikimedia\DependencyStore\KeyValueDependencyStore::getStoreKey (   $type,
  $entity 
)
private

◆ remove()

Wikimedia\DependencyStore\KeyValueDependencyStore::remove (   $type,
  $entities 
)

Delete the currently tracked dependencies for an entity or set of entities.

Parameters
string$typeEntity type
string | string[]$entitiesEntity name(s)
Exceptions
DependencyStoreException

Reimplemented from Wikimedia\DependencyStore\DependencyStore.

Definition at line 88 of file KeyValueDependencyStore.php.

References $keys, $type, Wikimedia\DependencyStore\KeyValueDependencyStore\getStoreKey(), and BagOStuff\WRITE_BACKGROUND.

◆ renew()

Wikimedia\DependencyStore\KeyValueDependencyStore::renew (   $type,
  $entities,
  $ttl 
)

Set the expiry for the currently tracked dependencies for an entity or set of entities.

Parameters
string$typeEntity type
string | string[]$entitiesEntity name(s)
int$ttlNew time-to-live in seconds
Exceptions
DependencyStoreException

Reimplemented from Wikimedia\DependencyStore\DependencyStore.

Definition at line 99 of file KeyValueDependencyStore.php.

References $keys, $type, Wikimedia\DependencyStore\KeyValueDependencyStore\getStoreKey(), and BagOStuff\WRITE_BACKGROUND.

◆ retrieveMulti()

Wikimedia\DependencyStore\KeyValueDependencyStore::retrieveMulti (   $type,
array  $entities 
)

Get the currently tracked dependencies for a set of entities.

See also
KeyValueDependencyStore::retrieve()
Parameters
string$typeEntity type
string[]$entitiesEntity names
Returns
array[] Map of (entity => (paths: paths, asOf: UNIX timestamp or null))
Exceptions
DependencyStoreException

Reimplemented from Wikimedia\DependencyStore\DependencyStore.

Definition at line 47 of file KeyValueDependencyStore.php.

References $blob, $type, Wikimedia\DependencyStore\KeyValueDependencyStore\getStoreKey(), and Wikimedia\DependencyStore\DependencyStore\newEntityDependencies().

◆ storeMulti()

Wikimedia\DependencyStore\KeyValueDependencyStore::storeMulti (   $type,
array  $dataByEntity,
  $ttl 
)

Set the currently tracked dependencies for a set of entities.

See also
KeyValueDependencyStore::store()
Parameters
string$typeEntity type
array[]$dataByEntityMap of (entity => (paths: paths, asOf: UNIX timestamp or null))
int$ttlNew time-to-live in seconds
Exceptions
DependencyStoreException

Reimplemented from Wikimedia\DependencyStore\DependencyStore.

Definition at line 68 of file KeyValueDependencyStore.php.

References $blob, $type, Wikimedia\DependencyStore\KeyValueDependencyStore\getStoreKey(), and BagOStuff\WRITE_BACKGROUND.

Member Data Documentation

◆ $stash

BagOStuff Wikimedia\DependencyStore\KeyValueDependencyStore::$stash
private

The documentation for this class was generated from the following file: