|
MediaWiki master
|
External storage in a SQL database. More...
Inherits MediaWiki\ExternalStore\ExternalStoreMedium.

Public Member Functions | |||||||||
| __construct (array $params) | |||||||||
| batchFetchFromURLs (array $urls) | |||||||||
| Fetch multiple URLs from given external store. | |||||||||
| fetchFromURL ( $url) | |||||||||
| Fetch data from given external store URL. | |||||||||
| getClusterForUrl ( $url) | |||||||||
| Get the cluster part of a URL. | |||||||||
| getDomainIdForCluster ( $cluster) | |||||||||
| Get the domain ID for a given cluster, which is false for the local wiki ID. | |||||||||
| getPrimary ( $cluster) | |||||||||
| Get a primary database connection for the specified cluster. | |||||||||
| getReplica ( $cluster) | |||||||||
| Get a replica DB connection for the specified cluster. | |||||||||
| getTable (string $cluster) | |||||||||
| Get the configured blobs table name for this database. | |||||||||
| initializeTable ( $cluster) | |||||||||
| Create the appropriate blobs table on this cluster. | |||||||||
| isReadOnly ( $location) | |||||||||
Check if a given location is read-only.
| |||||||||
| store ( $location, $data) | |||||||||
Insert a data item into a given location.
| |||||||||
Public Member Functions inherited from MediaWiki\ExternalStore\ExternalStoreMedium | |||||||||
| setLogger (LoggerInterface $logger) | |||||||||
Protected Member Functions | |
| parseURL ( $url) | |
Additional Inherited Members | |
Protected Attributes inherited from MediaWiki\ExternalStore\ExternalStoreMedium | |
| string | $dbDomain |
| Default database domain to store content under. | |
| bool | $isDbDomainExplicit |
| Whether this was factoried with an explicit DB domain. | |
| LoggerInterface | $logger |
| array | $params = [] |
| Usage context options for this instance. | |
External storage in a SQL database.
In this system, each store "location" maps to a database "cluster". The clusters must be defined in the normal LBFactory configuration.
Definition at line 29 of file ExternalStoreDB.php.
| MediaWiki\ExternalStore\ExternalStoreDB::__construct | ( | array | $params | ) |
| array | $params | Additional parameters include:
|
Reimplemented from MediaWiki\ExternalStore\ExternalStoreMedium.
Definition at line 38 of file ExternalStoreDB.php.
References MediaWiki\ExternalStore\ExternalStoreMedium\$params.
| MediaWiki\ExternalStore\ExternalStoreDB::batchFetchFromURLs | ( | array | $urls | ) |
Fetch multiple URLs from given external store.
The provided URLs are in the form of DB://cluster/id, or DB://cluster/id/itemid for concatenated storage if ConcatenatedGzipHistoryBlob was used.
| array | $urls | An array of external store URLs |
Reimplemented from MediaWiki\ExternalStore\ExternalStoreMedium.
Definition at line 77 of file ExternalStoreDB.php.
References $url, and MediaWiki\ExternalStore\ExternalStoreDB\parseURL().
| MediaWiki\ExternalStore\ExternalStoreDB::fetchFromURL | ( | $url | ) |
Fetch data from given external store URL.
The provided URL is in the form of DB://cluster/id or DB://cluster/id/itemid for concatenated storage if ConcatenatedGzipHistoryBlob was used.
| string | $url |
Reimplemented from MediaWiki\ExternalStore\ExternalStoreMedium.
Definition at line 56 of file ExternalStoreDB.php.
References $url, and MediaWiki\ExternalStore\ExternalStoreDB\parseURL().
| MediaWiki\ExternalStore\ExternalStoreDB::getClusterForUrl | ( | $url | ) |
Get the cluster part of a URL.
| string | $url |
Definition at line 423 of file ExternalStoreDB.php.
References $url.
| MediaWiki\ExternalStore\ExternalStoreDB::getDomainIdForCluster | ( | $cluster | ) |
Get the domain ID for a given cluster, which is false for the local wiki ID.
| string | $cluster |
Definition at line 435 of file ExternalStoreDB.php.
References Wikimedia\Rdbms\ServerInfo\WRITER_INDEX.
| MediaWiki\ExternalStore\ExternalStoreDB::getPrimary | ( | $cluster | ) |
Get a primary database connection for the specified cluster.
| string | $cluster | Cluster name |
Definition at line 171 of file ExternalStoreDB.php.
References DB_PRIMARY, and Wikimedia\Rdbms\ServerInfo\WRITER_INDEX.
Referenced by CgzCopyTransaction\commit(), MediaWiki\ExternalStore\ExternalStoreDB\initializeTable(), and MediaWiki\ExternalStore\ExternalStoreDB\store().
| MediaWiki\ExternalStore\ExternalStoreDB::getReplica | ( | $cluster | ) |
Get a replica DB connection for the specified cluster.
| string | $cluster | Cluster name |
Definition at line 153 of file ExternalStoreDB.php.
References DB_REPLICA, and Wikimedia\Rdbms\ServerInfo\WRITER_INDEX.
| MediaWiki\ExternalStore\ExternalStoreDB::getTable | ( | string | $cluster | ) |
Get the configured blobs table name for this database.
Typically, a suffix like "_clusterX" can be used to facilitate clean merging of read-only storage clusters by simply cloning tables to the new cluster servers.
| string | $cluster | Cluster name |
Definition at line 219 of file ExternalStoreDB.php.
References Wikimedia\Rdbms\ServerInfo\WRITER_INDEX.
Referenced by MediaWiki\ExternalStore\ExternalStoreDB\initializeTable(), and MediaWiki\ExternalStore\ExternalStoreDB\store().
| MediaWiki\ExternalStore\ExternalStoreDB::initializeTable | ( | $cluster | ) |
Create the appropriate blobs table on this cluster.
| string | $cluster |
Definition at line 232 of file ExternalStoreDB.php.
References $IP, MediaWiki\ExternalStore\ExternalStoreDB\getPrimary(), and MediaWiki\ExternalStore\ExternalStoreDB\getTable().
| MediaWiki\ExternalStore\ExternalStoreDB::isReadOnly | ( | $location | ) |
Check if a given location is read-only.
| string | $location | The location name |
Reimplemented from MediaWiki\ExternalStore\ExternalStoreMedium.
Definition at line 128 of file ExternalStoreDB.php.
|
protected |
| string | $url |
Definition at line 406 of file ExternalStoreDB.php.
Referenced by MediaWiki\ExternalStore\ExternalStoreDB\batchFetchFromURLs(), and MediaWiki\ExternalStore\ExternalStoreDB\fetchFromURL().
| MediaWiki\ExternalStore\ExternalStoreDB::store | ( | $location, | |
| $data ) |
Insert a data item into a given location.
| string | $location | The location name |
| string | $data | The data item |
| ExternalStoreException |
Reimplemented from MediaWiki\ExternalStore\ExternalStoreMedium.
Definition at line 108 of file ExternalStoreDB.php.
References MediaWiki\ExternalStore\ExternalStoreDB\getPrimary(), and MediaWiki\ExternalStore\ExternalStoreDB\getTable().
Referenced by CgzCopyTransaction\commit().