MediaWiki
REL1_22
|
Job wrapper for HTMLCacheUpdate. More...
Public Member Functions | |
__construct ($title, $params, $id=0) | |
Construct a job. | |
run () | |
Run the job. | |
Public Attributes | |
$rowsPerQuery | |
Protected Member Functions | |
doFullUpdate () | |
Update all of the backlinks. | |
doPartialUpdate () | |
Update some of the backlinks, defined by a page ID range. | |
insertJobsFromTitles ($titleArray, $rootJobParams=array()) | |
Partition the current range given by $this->params['start'] and $this->params['end'], using a pre-calculated title array which gives the links in that range. | |
insertPartitionJobs ($rootJobParams=array()) | |
invalidateTitles ($titleArray) | |
Invalidate an array (or iterator) of Title objects, right now. | |
Protected Attributes | |
BacklinkCache | $blCache |
* | |
$rowsPerJob |
Job wrapper for HTMLCacheUpdate.
Gets run whenever a related job gets called from the queue.
This class is designed to work efficiently with small numbers of links, and to work reasonably well with up to ~10^5 links. Above ~10^6 links, the memory and time requirements of loading all backlinked IDs in doUpdate() might become prohibitive. The requirements measured at Wikimedia are approximately:
memory: 48 bytes per row time: 16us per row for the query plus processing
The reason this query is done is to support partitioning of the job by backlinked ID. The memory issue could be allieviated by doing this query in batches, but of course LIMIT with an offset is inefficient on the DB side.
The class is nevertheless a vast improvement on the previous method of using File::getLinksTo() and Title::touchArray(), which uses about 2KB of memory per link.
Definition at line 46 of file HTMLCacheUpdateJob.php.
HTMLCacheUpdateJob::__construct | ( | $ | title, |
$ | params, | ||
$ | id = 0 |
||
) |
Construct a job.
$title | Title: the title linked to | |
array | $params | job parameters (table, start and end page_ids) |
$id | Integer: job id |
Definition at line 57 of file HTMLCacheUpdateJob.php.
HTMLCacheUpdateJob::doFullUpdate | ( | ) | [protected] |
Update all of the backlinks.
Definition at line 80 of file HTMLCacheUpdateJob.php.
Referenced by run().
HTMLCacheUpdateJob::doPartialUpdate | ( | ) | [protected] |
Update some of the backlinks, defined by a page ID range.
Definition at line 113 of file HTMLCacheUpdateJob.php.
Referenced by run().
HTMLCacheUpdateJob::insertJobsFromTitles | ( | $ | titleArray, |
$ | rootJobParams = array() |
||
) | [protected] |
Partition the current range given by $this->params['start'] and $this->params['end'], using a pre-calculated title array which gives the links in that range.
Queue the resulting jobs.
$titleArray | array |
$rootJobParams | array |
Definition at line 137 of file HTMLCacheUpdateJob.php.
HTMLCacheUpdateJob::insertPartitionJobs | ( | $ | rootJobParams = array() | ) | [protected] |
HTMLCacheUpdateJob::invalidateTitles | ( | $ | titleArray | ) | [protected] |
Invalidate an array (or iterator) of Title objects, right now.
$titleArray | array |
Definition at line 217 of file HTMLCacheUpdateJob.php.
Run the job.
Reimplemented from Job.
Definition at line 67 of file HTMLCacheUpdateJob.php.
References doFullUpdate(), doPartialUpdate(), and params.
BacklinkCache HTMLCacheUpdateJob::$blCache [protected] |
*
Definition at line 47 of file HTMLCacheUpdateJob.php.
HTMLCacheUpdateJob::$rowsPerJob [protected] |
Definition at line 49 of file HTMLCacheUpdateJob.php.
HTMLCacheUpdateJob::$rowsPerQuery |
Definition at line 49 of file HTMLCacheUpdateJob.php.