MediaWiki master
|
External storage in a SQL database. More...
Inherits 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.
| |||||||||
![]() | |||||||||
setLogger (LoggerInterface $logger) | |||||||||
Protected Member Functions | |
parseURL ( $url) | |
Additional Inherited Members | |
![]() | |
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 38 of file ExternalStoreDB.php.
ExternalStoreDB::__construct | ( | array | $params | ) |
array | $params | Additional parameters include:
|
Reimplemented from ExternalStoreMedium.
Definition at line 47 of file ExternalStoreDB.php.
References $params.
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 ExternalStoreMedium.
Definition at line 86 of file ExternalStoreDB.php.
References $url, and parseURL().
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 ExternalStoreMedium.
Definition at line 65 of file ExternalStoreDB.php.
References $url, and parseURL().
ExternalStoreDB::getClusterForUrl | ( | $url | ) |
Get the cluster part of a URL.
string | $url |
Definition at line 432 of file ExternalStoreDB.php.
References $url.
ExternalStoreDB::getDomainIdForCluster | ( | $cluster | ) |
Get the domain ID for a given cluster, which is false for the local wiki ID.
string | $cluster |
Definition at line 444 of file ExternalStoreDB.php.
ExternalStoreDB::getPrimary | ( | $cluster | ) |
Get a primary database connection for the specified cluster.
string | $cluster | Cluster name |
Definition at line 180 of file ExternalStoreDB.php.
References DB_PRIMARY.
Referenced by CgzCopyTransaction\commit(), initializeTable(), and store().
ExternalStoreDB::getReplica | ( | $cluster | ) |
Get a replica DB connection for the specified cluster.
string | $cluster | Cluster name |
Definition at line 162 of file ExternalStoreDB.php.
References DB_REPLICA.
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 228 of file ExternalStoreDB.php.
Referenced by initializeTable(), and store().
ExternalStoreDB::initializeTable | ( | $cluster | ) |
Create the appropriate blobs table on this cluster.
string | $cluster |
Definition at line 241 of file ExternalStoreDB.php.
References $IP, getPrimary(), and getTable().
ExternalStoreDB::isReadOnly | ( | $location | ) |
Check if a given location is read-only.
string | $location | The location name |
Reimplemented from ExternalStoreMedium.
Definition at line 137 of file ExternalStoreDB.php.
|
protected |
string | $url |
Definition at line 415 of file ExternalStoreDB.php.
Referenced by batchFetchFromURLs(), and fetchFromURL().
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 ExternalStoreMedium.
Definition at line 117 of file ExternalStoreDB.php.
References getPrimary(), and getTable().
Referenced by CgzCopyTransaction\commit().