MediaWiki REL1_33
|
DB accessible external objects. More...
Public Member Functions | |
batchFetchFromURLs (array $urls) | |
Fetch data from given external store URLs. | |
fetchFromURL ( $url) | |
The provided URL is in the form of DB://cluster/id or DB://cluster/id/itemid for concatened storage. | |
getMaster ( $cluster) | |
Get a master database connection for the specified cluster. | |
getSlave ( $cluster) | |
Get a replica DB connection for the specified cluster. | |
getTable ( $db) | |
Get the 'blobs' table name for this database. | |
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 ExternalStoreMedium | |
__construct (array $params=[]) | |
Protected Member Functions | |
parseURL ( $url) | |
Private Member Functions | |
batchFetchBlobs ( $cluster, array $ids) | |
Fetch multiple blob items out of the database. | |
fetchBlob ( $cluster, $id, $itemID) | |
Fetch a blob item out of the database; a cache of the last-loaded blob will be kept so that multiple loads out of a multi-item blob can avoid redundant database access and decompression. | |
getDomainId (array $server) | |
getLoadBalancer ( $cluster) | |
Get a LoadBalancer for the specified cluster. | |
mergeBatchResult (array &$ret, array &$ids, $res) | |
Helper function for self::batchFetchBlobs for merging master/replica DB results. | |
Additional Inherited Members | |
Protected Attributes inherited from ExternalStoreMedium | |
array | $params = [] |
DB accessible external objects.
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.
|
private |
Fetch multiple blob items out of the database.
string | $cluster | A cluster name valid for use with LBFactory |
array | $ids | A map from the blob_id's to look for to the requested itemIDs in the blobs |
Definition at line 274 of file ExternalStoreDB.php.
References $dbr, $res, $ret, and(), getMaster(), getSlave(), getTable(), mergeBatchResult(), and wfDebugLog().
Referenced by batchFetchFromURLs().
ExternalStoreDB::batchFetchFromURLs | ( | array | $urls | ) |
Fetch data from given external store URLs.
The provided URLs are in the form of DB://cluster/id or DB://cluster/id/itemid for concatened storage.
array | $urls | An array of external store URLs |
Reimplemented from ExternalStoreMedium.
Definition at line 67 of file ExternalStoreDB.php.
References $blob, $res, $ret, $urls, and(), batchFetchBlobs(), list, and parseURL().
|
private |
Fetch a blob item out of the database; a cache of the last-loaded blob will be kept so that multiple loads out of a multi-item blob can avoid redundant database access and decompression.
string | $cluster | |
string | $id | |
string | $itemID |
Definition at line 217 of file ExternalStoreDB.php.
References $dbr, $ret, and(), false, getMaster(), getSlave(), getTable(), unserialize(), and wfDebugLog().
Referenced by fetchFromURL().
ExternalStoreDB::fetchFromURL | ( | $url | ) |
The provided URL is in the form of DB://cluster/id or DB://cluster/id/itemid for concatened storage.
string | $url |
Reimplemented from ExternalStoreMedium.
Definition at line 47 of file ExternalStoreDB.php.
References $ret, fetchBlob(), list, and parseURL().
|
private |
array | $server | Master DB server configuration array for LoadBalancer |
Definition at line 170 of file ExternalStoreDB.php.
References and().
Referenced by getMaster(), getSlave(), and isReadOnly().
|
private |
Get a LoadBalancer for the specified cluster.
string | $cluster | Cluster name |
Definition at line 120 of file ExternalStoreDB.php.
Referenced by getMaster(), getSlave(), and isReadOnly().
ExternalStoreDB::getMaster | ( | $cluster | ) |
Get a master database connection for the specified cluster.
string | $cluster | Cluster name |
Definition at line 156 of file ExternalStoreDB.php.
References DB_MASTER, DBO_TRX, getDomainId(), and getLoadBalancer().
Referenced by batchFetchBlobs(), fetchBlob(), and store().
ExternalStoreDB::getSlave | ( | $cluster | ) |
Get a replica DB connection for the specified cluster.
string | $cluster | Cluster name |
Definition at line 131 of file ExternalStoreDB.php.
References $wgDefaultExternalStore, and(), array(), DB_REPLICA, DBO_TRX, getDomainId(), getLoadBalancer(), and wfDebug().
Referenced by batchFetchBlobs(), and fetchBlob().
ExternalStoreDB::getTable | ( | $db | ) |
Get the 'blobs' table name for this database.
IDatabase | $db |
Definition at line 199 of file ExternalStoreDB.php.
References and().
Referenced by batchFetchBlobs(), fetchBlob(), and store().
ExternalStoreDB::isReadOnly | ( | $location | ) |
Check if a given location is read-only.
string | $location | The location name |
Reimplemented from ExternalStoreMedium.
Definition at line 108 of file ExternalStoreDB.php.
References getDomainId(), and getLoadBalancer().
Helper function for self::batchFetchBlobs for merging master/replica DB results.
array | &$ret | Current self::batchFetchBlobs return value |
array | &$ids | Map from blob_id to requested itemIDs |
mixed | $res | DB result from Database::select |
Definition at line 313 of file ExternalStoreDB.php.
References $res, $ret, and(), and unserialize().
Referenced by batchFetchBlobs().
|
protected |
string | $url |
Definition at line 332 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 |
MWException |
Reimplemented from ExternalStoreMedium.
Definition at line 95 of file ExternalStoreDB.php.
References $data, getMaster(), and getTable().
Referenced by CompressOld\compressPage().