MediaWiki REL1_37
Wikimedia\DependencyStore\SqlModuleDependencyStore Class Reference

Class for tracking per-entity dependency path lists in the module_deps table. More...

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

Public Member Functions

 __construct (ILoadBalancer $lb)
 
 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.
 
 retrieveMulti ( $type, array $entities)
 Get the currently tracked dependencies for a set of entities.
 
 storeMulti ( $type, array $dataByEntity, $ttl)
 Set the currently tracked dependencies for a set of entities.
 
- Public Member Functions inherited from Wikimedia\DependencyStore\DependencyStore
 newEntityDependencies (array $paths=[], $asOf=null)
 
 retrieve ( $type, $entity)
 Get the currently tracked dependencies for an entity.
 
 store ( $type, $entity, array $data, $ttl)
 Set the currently tracked dependencies for an entity.
 

Private Member Functions

 fetchDependencyBlobs (array $entities, IDatabase $db)
 
 getEntityNameComponents ( $entity)
 
 getPrimaryDb ()
 
 getReplicaDb ()
 

Private Attributes

ILoadBalancer $lb
 

Detailed Description

Class for tracking per-entity dependency path lists in the module_deps table.

This should not be used outside of ResourceLoader and ResourceLoaderModule

Access: internal
For use with ResourceLoader/ResourceLoaderModule only
Since
1.35

Definition at line 37 of file SqlModuleDependencyStore.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\DependencyStore\SqlModuleDependencyStore::__construct ( ILoadBalancer  $lb)
Parameters
ILoadBalancer$lbStorage backend

Definition at line 44 of file SqlModuleDependencyStore.php.

References Wikimedia\DependencyStore\SqlModuleDependencyStore\$lb.

Member Function Documentation

◆ fetchDependencyBlobs()

Wikimedia\DependencyStore\SqlModuleDependencyStore::fetchDependencyBlobs ( array  $entities,
IDatabase  $db 
)
private

◆ getEntityNameComponents()

Wikimedia\DependencyStore\SqlModuleDependencyStore::getEntityNameComponents (   $entity)
private

◆ getPrimaryDb()

Wikimedia\DependencyStore\SqlModuleDependencyStore::getPrimaryDb ( )
private
Returns
DBConnRef

Definition at line 208 of file SqlModuleDependencyStore.php.

References DB_PRIMARY.

◆ getReplicaDb()

Wikimedia\DependencyStore\SqlModuleDependencyStore::getReplicaDb ( )
private
Returns
DBConnRef

Definition at line 200 of file SqlModuleDependencyStore.php.

References DB_REPLICA.

Referenced by Wikimedia\DependencyStore\SqlModuleDependencyStore\retrieveMulti().

◆ remove()

Wikimedia\DependencyStore\SqlModuleDependencyStore::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 123 of file SqlModuleDependencyStore.php.

References Wikimedia\DependencyStore\SqlModuleDependencyStore\getEntityNameComponents().

◆ renew()

Wikimedia\DependencyStore\SqlModuleDependencyStore::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 154 of file SqlModuleDependencyStore.php.

◆ retrieveMulti()

Wikimedia\DependencyStore\SqlModuleDependencyStore::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 48 of file SqlModuleDependencyStore.php.

References $dbr, Wikimedia\DependencyStore\SqlModuleDependencyStore\fetchDependencyBlobs(), Wikimedia\DependencyStore\SqlModuleDependencyStore\getReplicaDb(), and Wikimedia\DependencyStore\DependencyStore\newEntityDependencies().

◆ storeMulti()

Wikimedia\DependencyStore\SqlModuleDependencyStore::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 71 of file SqlModuleDependencyStore.php.

References $blob, Wikimedia\DependencyStore\SqlModuleDependencyStore\fetchDependencyBlobs(), and Wikimedia\DependencyStore\SqlModuleDependencyStore\getEntityNameComponents().

Member Data Documentation

◆ $lb

ILoadBalancer Wikimedia\DependencyStore\SqlModuleDependencyStore::$lb
private

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