MediaWiki
1.23.2
|
Class to handle enqueueing of background jobs. More...
Public Member Functions | |
ack (Job $job) | |
Acknowledge that a job was completed. More... | |
deduplicateRootJob (Job $job) | |
Register the "root job" of a given job into the queue for de-duplication. More... | |
executeReadyPeriodicTasks () | |
Execute any due periodic queue maintenance tasks for all queues. More... | |
get ( $type) | |
Get the job queue object for a given queue type. More... | |
getDefaultQueueTypes () | |
Get the list of default queue types. More... | |
getQueueSizes () | |
Get the size of the queus for a list of job types. More... | |
getQueuesWithJobs () | |
Get the list of job types that have non-empty queues. More... | |
getQueueTypes () | |
Get the list of queue types. More... | |
pop ( $qtype=self::TYPE_DEFAULT, $flags=0, array $blacklist=array()) | |
Pop a job off one of the job queues. More... | |
push ( $jobs) | |
Insert jobs into the respective queues of with the belong. More... | |
queuesHaveJobs ( $type=self::TYPE_ANY) | |
Check if there are any queues with jobs (this is cached) More... | |
waitForBackups () | |
Wait for any slaves or backup queue servers to catch up. More... | |
Static Public Member Functions | |
static | destroySingletons () |
Destroy the singleton instances. More... | |
static | singleton ( $wiki=false) |
Public Attributes | |
const | CACHE_VERSION = 1 |
const | PROC_CACHE_TTL = 15 |
const | TYPE_ANY = 2 |
const | TYPE_DEFAULT = 1 |
const | USE_CACHE = 1 |
Protected Member Functions | |
__construct ( $wiki) | |
getCoalescedQueues () | |
Protected Attributes | |
ProcessCacheLRU | $cache |
array | $coalescedQueues |
Map of (bucket => (queue => JobQueue, types => list of types) *. More... | |
string | $wiki |
Wiki ID *. More... | |
Static Protected Attributes | |
static | $instances = array() |
Private Member Functions | |
getCachedConfigVar ( $name) | |
Class to handle enqueueing of background jobs.
Definition at line 30 of file JobQueueGroup.php.
|
protected |
string | $wiki | Wiki ID |
Definition at line 52 of file JobQueueGroup.php.
JobQueueGroup::ack | ( | Job | $job | ) |
Acknowledge that a job was completed.
Job | $job |
Definition at line 200 of file JobQueueGroup.php.
References $job, and Job\getType().
JobQueueGroup::deduplicateRootJob | ( | Job | $job | ) |
Register the "root job" of a given job into the queue for de-duplication.
This should only be called right after all the new jobs have been inserted.
Job | $job |
Definition at line 211 of file JobQueueGroup.php.
References $job, and Job\getType().
|
static |
Destroy the singleton instances.
Definition at line 75 of file JobQueueGroup.php.
References array().
Referenced by TemplateCategoriesTest\testTemplateCategories().
JobQueueGroup::executeReadyPeriodicTasks | ( | ) |
Execute any due periodic queue maintenance tasks for all queues.
A task is "due" if the time ellapsed since the last run is greater than the defined run period. Concurrent calls to this function will cause tasks to be attempted twice, so they may need their own methods of mutual exclusion.
Definition at line 362 of file JobQueueGroup.php.
References $cache, $count, $e, $timestamp, $type, $wgMemc, array(), as, getQueueTypes(), global, list, MWExceptionHandler\logException(), JobQueueAggregator\singleton(), wfForeignMemcKey(), wfSplitWikiID(), and wiki.
JobQueueGroup::get | ( | $type | ) |
Get the job queue object for a given queue type.
string | $type |
Definition at line 85 of file JobQueueGroup.php.
References $type, array(), JobQueue\factory(), global, and wiki.
|
private |
$name | string |
Definition at line 420 of file JobQueueGroup.php.
References $GLOBALS, $name, $value, $wgMemc, array(), global, list, wfForeignMemcKey(), wfSplitWikiID(), wfWikiID(), and wiki.
Referenced by getQueueTypes().
|
protected |
Definition at line 326 of file JobQueueGroup.php.
References $coalescedQueues, $type, array(), as, JobQueue\factory(), getQueueTypes(), global, and wiki.
Referenced by getQueueSizes(), and getQueuesWithJobs().
JobQueueGroup::getDefaultQueueTypes | ( | ) |
Get the list of default queue types.
Definition at line 248 of file JobQueueGroup.php.
References getQueueTypes(), and global.
Referenced by pop(), and queuesHaveJobs().
JobQueueGroup::getQueueSizes | ( | ) |
Get the size of the queus for a list of job types.
Definition at line 307 of file JobQueueGroup.php.
References $type, array(), as, getCoalescedQueues(), and getQueueTypes().
JobQueueGroup::getQueuesWithJobs | ( | ) |
Get the list of job types that have non-empty queues.
Definition at line 284 of file JobQueueGroup.php.
References $type, array(), as, getCoalescedQueues(), and getQueueTypes().
Referenced by pop(), and queuesHaveJobs().
JobQueueGroup::getQueueTypes | ( | ) |
Get the list of queue types.
Definition at line 239 of file JobQueueGroup.php.
References getCachedConfigVar().
Referenced by executeReadyPeriodicTasks(), getCoalescedQueues(), getDefaultQueueTypes(), getQueueSizes(), and getQueuesWithJobs().
Pop a job off one of the job queues.
This pops a job off a queue as specified by $wgJobTypeConf and updates the aggregate job queue information cache as needed.
int | string | $qtype | JobQueueGroup::TYPE_* constant or job type string |
int | $flags | Bitfield of JobQueueGroup::USE_* constants |
array | $blacklist | List of job types to ignore |
Definition at line 153 of file JobQueueGroup.php.
References $flags, $job, $type, as, cache, getDefaultQueueTypes(), getQueuesWithJobs(), JobQueueAggregator\singleton(), and wiki.
JobQueueGroup::push | ( | $jobs | ) |
Insert jobs into the respective queues of with the belong.
This inserts the jobs into the queue specified by $wgJobTypeConf and updates the aggregate job queue information cache as needed.
MWException |
Definition at line 108 of file JobQueueGroup.php.
References $job, $ok, $type, array(), as, cache, JobQueueAggregator\singleton(), and wiki.
JobQueueGroup::queuesHaveJobs | ( | $type = self::TYPE_ANY | ) |
Check if there are any queues with jobs (this is cached)
integer | $type | JobQueueGroup::TYPE_* constant |
Definition at line 261 of file JobQueueGroup.php.
References $type, $value, $wgMemc, getDefaultQueueTypes(), getQueuesWithJobs(), global, and wfMemcKey().
|
static |
bool | string | $wiki | Wiki ID |
Definition at line 61 of file JobQueueGroup.php.
References $wiki, false, and wfWikiID().
Referenced by Job\batchInsert(), UploadFromUrlTest\doAsyncUpload(), HTMLCacheUpdate\doUpdate(), CopyJobQueue\execute(), ShowJobs\execute(), RunJobs\execute(), SpecialRunJobs\executeJobs(), NextJobDB\executeReadyPeriodicTasks(), JobQueueAggregator\findPendingWikiQueues(), DoubleRedirectJob\fixRedirects(), ApiUpload\getChunkResult(), Job\insert(), UploadFromUrl\insertJob(), SiteStats\jobs(), EmailNotification\notifyOnPageChange(), ApiUpload\performUpload(), Job\pop(), Job\pop_type(), FixDoubleRedirects\queueJobs(), LinksUpdate\queueRecursiveJobsForTable(), HTMLCacheUpdateJob\run(), RefreshLinksJob2\run(), RefreshLinksJob\run(), NullJob\run(), Job\safeBatchInsert(), UploadFromUrlTest\testClearQueue(), UploadFromUrlTest\testLeaveMessage(), UploadFromUrlTest\testSetupUrlDownload(), UploadFromUrlTest\testSyncDownload(), and MediaWiki\triggerJobs().
JobQueueGroup::waitForBackups | ( | ) |
Wait for any slaves or backup queue servers to catch up.
This does nothing for certain queue classes.
MWException |
Definition at line 223 of file JobQueueGroup.php.
References $type, as, global, wfProfileIn(), and wfProfileOut().
|
protected |
|
protected |
Map of (bucket => (queue => JobQueue, types => list of types) *.
Definition at line 38 of file JobQueueGroup.php.
Referenced by getCoalescedQueues().
|
staticprotected |
Definition at line 32 of file JobQueueGroup.php.
|
protected |
Wiki ID *.
Definition at line 36 of file JobQueueGroup.php.
Referenced by __construct(), and singleton().
const JobQueueGroup::CACHE_VERSION = 1 |
Definition at line 47 of file JobQueueGroup.php.
const JobQueueGroup::PROC_CACHE_TTL = 15 |
Definition at line 45 of file JobQueueGroup.php.
const JobQueueGroup::TYPE_ANY = 2 |
Definition at line 41 of file JobQueueGroup.php.
const JobQueueGroup::TYPE_DEFAULT = 1 |
Definition at line 40 of file JobQueueGroup.php.
Referenced by RunJobs\execute(), SpecialRunJobs\executeJobs(), and MediaWiki\triggerJobs().
const JobQueueGroup::USE_CACHE = 1 |
Definition at line 43 of file JobQueueGroup.php.
Referenced by RunJobs\execute(), and SpecialRunJobs\executeJobs().