Public Member Functions | |
__construct ($titleTo, $table) | |
doUpdate () | |
invalidate ($startId=false, $endId=false) | |
Invalidate a set of pages, right now. | |
Public Attributes | |
$mTitle | |
$mTable | |
$mPrefix | |
$mRowsPerJob | |
$mRowsPerQuery | |
Protected Member Functions | |
insertJobs () |
Small numbers of links will be done immediately, large numbers are pushed onto the job 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 Image::getLinksTo() and Title::touchArray(), which uses about 2KB of memory per link.
Definition at line 26 of file HTMLCacheUpdate.php.
HTMLCacheUpdate::__construct | ( | $ | titleTo, | |
$ | table | |||
) |
Definition at line 31 of file HTMLCacheUpdate.php.
References $wgUpdateRowsPerJob, and $wgUpdateRowsPerQuery.
HTMLCacheUpdate::doUpdate | ( | ) |
Definition at line 41 of file HTMLCacheUpdate.php.
References $numRows, insertJobs(), invalidate(), and wfRunHooks().
HTMLCacheUpdate::insertJobs | ( | ) | [protected] |
Definition at line 55 of file HTMLCacheUpdate.php.
References $batch, and Job::batchInsert().
Referenced by doUpdate().
HTMLCacheUpdate::invalidate | ( | $ | startId = false , |
|
$ | endId = false | |||
) |
Invalidate a set of pages, right now.
Definition at line 75 of file HTMLCacheUpdate.php.
References $dbw, $endId, $startId, $title, $u, $wgUseFileCache, $wgUseSquid, HTMLFileCache::clearFileCache(), SquidUpdate::newFromTitles(), and wfGetDB().
Referenced by doUpdate().
HTMLCacheUpdate::$mPrefix |
Definition at line 28 of file HTMLCacheUpdate.php.
HTMLCacheUpdate::$mRowsPerJob |
Definition at line 29 of file HTMLCacheUpdate.php.
HTMLCacheUpdate::$mRowsPerQuery |
Definition at line 29 of file HTMLCacheUpdate.php.
HTMLCacheUpdate::$mTable |
Definition at line 28 of file HTMLCacheUpdate.php.
HTMLCacheUpdate::$mTitle |
Definition at line 28 of file HTMLCacheUpdate.php.