MediaWiki
1.23.5
|
DB accessable external objects. More...
Public Member Functions | |
batchFetchBlobs ( $cluster, array $ids) | |
Fetch multiple blob items out of the database. More... | |
batchFetchFromURLs (array $urls) | |
Fetch data from given external store URLs. More... | |
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. More... | |
fetchFromURL ( $url) | |
The provided URL is in the form of DB://cluster/id or DB://cluster/id/itemid for concatened storage. More... | |
getLoadBalancer ( $cluster) | |
Get a LoadBalancer for the specified cluster. More... | |
getMaster ( $cluster) | |
Get a master database connection for the specified cluster. More... | |
getSlave ( $cluster) | |
Get a slave database connection for the specified cluster. More... | |
getTable ( $db) | |
Get the 'blobs' table name for this database. More... | |
store ( $cluster, $data) | |
Public Member Functions inherited from ExternalStoreMedium | |
__construct (array $params=array()) | |
Protected Member Functions | |
parseURL ( $url) | |
Private Member Functions | |
mergeBatchResult (array &$ret, array &$ids, $res) | |
Helper function for self::batchFetchBlobs for merging master/slave results. More... | |
Additional Inherited Members | |
Protected Attributes inherited from ExternalStoreMedium | |
Array | $params = array() |
DB accessable 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 31 of file ExternalStoreDB.php.
ExternalStoreDB::batchFetchBlobs | ( | $cluster, | |
array | $ids | ||
) |
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 231 of file ExternalStoreDB.php.
References $dbr, $res, $ret, array(), 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 58 of file ExternalStoreDB.php.
References $blob, $res, $ret, array(), as, batchFetchBlobs(), list, and parseURL().
ExternalStoreDB::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.
$cluster | |
$id | |
$itemID |
Definition at line 178 of file ExternalStoreDB.php.
References $dbr, $ret, array(), false, getMaster(), getSlave(), getTable(), 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.
Reimplemented from ExternalStoreMedium.
Definition at line 38 of file ExternalStoreDB.php.
References $ret, fetchBlob(), list, and parseURL().
ExternalStoreDB::getLoadBalancer | ( | $cluster | ) |
Get a LoadBalancer for the specified cluster.
string | $cluster | cluster name |
Definition at line 112 of file ExternalStoreDB.php.
References wfGetLBFactory().
Referenced by getMaster(), and getSlave().
ExternalStoreDB::getMaster | ( | $cluster | ) |
Get a master database connection for the specified cluster.
string | $cluster | cluster name |
Definition at line 146 of file ExternalStoreDB.php.
References $lb, array(), DB_MASTER, and getLoadBalancer().
Referenced by batchFetchBlobs(), fetchBlob(), and store().
ExternalStoreDB::getSlave | ( | $cluster | ) |
Get a slave database connection for the specified cluster.
string | $cluster | cluster name |
Definition at line 124 of file ExternalStoreDB.php.
References $lb, array(), DB_SLAVE, getLoadBalancer(), global, and wfDebug().
Referenced by batchFetchBlobs(), and fetchBlob().
ExternalStoreDB::getTable | ( | $db | ) |
Get the 'blobs' table name for this database.
$db | DatabaseBase |
Definition at line 159 of file ExternalStoreDB.php.
Referenced by batchFetchBlobs(), fetchBlob(), and store().
Helper function for self::batchFetchBlobs for merging master/slave results.
array | &$ret | Current self::batchFetchBlobs return value |
array | &$ids | Map from blob_id to requested itemIDs |
mixed | $res | DB result from DatabaseBase::select |
Definition at line 270 of file ExternalStoreDB.php.
References $res, $ret, and as.
Referenced by batchFetchBlobs().
|
protected |
Definition at line 285 of file ExternalStoreDB.php.
References $path, and array().
Referenced by batchFetchFromURLs(), and fetchFromURL().
ExternalStoreDB::store | ( | $cluster, | |
$data | |||
) |
Reimplemented from ExternalStoreMedium.
Definition at line 89 of file ExternalStoreDB.php.
References array(), DBO_TRX, getMaster(), and getTable().
Referenced by CompressOld\compressPage().