|
MediaWiki REL1_39
|
Class to handle enqueueing of background jobs. More...

Public Member Functions | |
| __construct ( $domain, ConfiguredReadOnlyMode $readOnlyMode, bool $invalidDomain, array $jobClasses, array $jobTypeConfiguration, array $jobTypesExcludedFromDefaultQueue, IBufferingStatsdDataFactory $statsdDataFactory, WANObjectCache $wanCache, GlobalIdGenerator $globalIdGenerator) | |
| ack (RunnableJob $job) | |
| Acknowledge that a job was completed. | |
| deduplicateRootJob (RunnableJob $job) | |
| Register the "root job" of a given job into the queue for de-duplication. | |
| get ( $type) | |
| Get the job queue object for a given queue type. | |
| getDefaultQueueTypes () | |
| Get the list of default queue types. | |
| getQueueSizes () | |
| Get the size of the queues for a list of job types. | |
| getQueuesWithJobs () | |
| Get the list of job types that have non-empty queues. | |
| getQueueTypes () | |
| Get the list of queue types. | |
| lazyPush ( $jobs) | |
| Buffer jobs for insertion via push() or call it now if in CLI mode. | |
| pop ( $qtype=self::TYPE_DEFAULT, $flags=0, array $ignored=[]) | |
| Pop a job off one of the job queues. | |
| push ( $jobs) | |
| Insert jobs into the respective queues of which they belong. | |
| queuesHaveJobs ( $type=self::TYPE_ANY) | |
| Check if there are any queues with jobs (this is cached) | |
| waitForBackups () | |
| Wait for any replica DBs or backup queue servers to catch up. | |
Static Public Member Functions | |
| static | destroySingletons () |
| Destroy the singleton instances. | |
| static | singleton ( $domain=false) |
Public Attributes | |
| const | TYPE_DEFAULT = 1 |
| const | USE_CACHE = 1 |
Protected Member Functions | |
| getCoalescedQueues () | |
Protected Attributes | |
| MapCacheLRU | $cache |
| array | $coalescedQueues |
| Map of (bucket => (queue => JobQueue, types => list of types) | |
| string | $domain |
| Wiki domain ID. | |
| bool | $invalidDomain = false |
| Whether the wiki is not recognized in configuration. | |
| ConfiguredReadOnlyMode | $readOnlyMode |
| Read only mode. | |
Static Protected Attributes | |
| static JobQueueGroup[] | $instances = [] |
Class to handle enqueueing of background jobs.
Definition at line 32 of file JobQueueGroup.php.
| JobQueueGroup::__construct | ( | $domain, | |
| ConfiguredReadOnlyMode | $readOnlyMode, | ||
| bool | $invalidDomain, | ||
| array | $jobClasses, | ||
| array | $jobTypeConfiguration, | ||
| array | $jobTypesExcludedFromDefaultQueue, | ||
| IBufferingStatsdDataFactory | $statsdDataFactory, | ||
| WANObjectCache | $wanCache, | ||
| GlobalIdGenerator | $globalIdGenerator ) |
| string | $domain | Wiki domain ID |
| ConfiguredReadOnlyMode | $readOnlyMode | Read-only mode |
| bool | $invalidDomain | Whether the wiki is not recognized in configuration |
| array | $jobClasses | |
| array | $jobTypeConfiguration | |
| array | $jobTypesExcludedFromDefaultQueue | |
| IBufferingStatsdDataFactory | $statsdDataFactory | |
| WANObjectCache | $wanCache | |
| GlobalIdGenerator | $globalIdGenerator |
Definition at line 86 of file JobQueueGroup.php.
| JobQueueGroup::ack | ( | RunnableJob | $job | ) |
Acknowledge that a job was completed.
| RunnableJob | $job |
Definition at line 305 of file JobQueueGroup.php.
References $job, ack(), and IJobSpecification\getType().
Referenced by ack().
| JobQueueGroup::deduplicateRootJob | ( | RunnableJob | $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.
| RunnableJob | $job |
Definition at line 316 of file JobQueueGroup.php.
References $job, deduplicateRootJob(), and IJobSpecification\getType().
Referenced by deduplicateRootJob().
|
static |
Destroy the singleton instances.
Definition at line 125 of file JobQueueGroup.php.
References wfDeprecated().
| JobQueueGroup::get | ( | $type | ) |
Get the job queue object for a given queue type.
| string | $type |
Definition at line 135 of file JobQueueGroup.php.
References $type, and JobQueue\factory().
Referenced by ApiUpload\__construct().
|
protected |
Definition at line 428 of file JobQueueGroup.php.
References $queue, $type, JobQueue\factory(), and getQueueTypes().
Referenced by getQueueSizes(), and getQueuesWithJobs().
| JobQueueGroup::getDefaultQueueTypes | ( | ) |
Get the list of default queue types.
Definition at line 348 of file JobQueueGroup.php.
References getQueueTypes().
Referenced by pop(), and queuesHaveJobs().
| JobQueueGroup::getQueueSizes | ( | ) |
Get the size of the queues for a list of job types.
Definition at line 406 of file JobQueueGroup.php.
References $queue, $type, getCoalescedQueues(), and getQueueTypes().
| JobQueueGroup::getQueuesWithJobs | ( | ) |
Get the list of job types that have non-empty queues.
Definition at line 381 of file JobQueueGroup.php.
References $queue, $type, getCoalescedQueues(), and getQueueTypes().
Referenced by pop(), and queuesHaveJobs().
| JobQueueGroup::getQueueTypes | ( | ) |
Get the list of queue types.
Definition at line 339 of file JobQueueGroup.php.
Referenced by getCoalescedQueues(), getDefaultQueueTypes(), getQueueSizes(), and getQueuesWithJobs().
| JobQueueGroup::lazyPush | ( | $jobs | ) |
Buffer jobs for insertion via push() or call it now if in CLI mode.
| IJobSpecification | IJobSpecification[] | $jobs | A single Job or a list of Jobs |
Definition at line 224 of file JobQueueGroup.php.
References push().
| JobQueueGroup::pop | ( | $qtype = self::TYPE_DEFAULT, | |
| $flags = 0, | |||
| array | $ignored = [] ) |
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 | $ignored | List of job types to ignore |
Definition at line 254 of file JobQueueGroup.php.
References $job, $type, getDefaultQueueTypes(), getQueuesWithJobs(), and pop().
Referenced by pop().
| JobQueueGroup::push | ( | $jobs | ) |
Insert jobs into the respective queues of which they belong.
This inserts the jobs into the queue specified by $wgJobTypeConf and updates the aggregate job queue information cache as needed.
| IJobSpecification | IJobSpecification[] | $jobs | A single Job or a list of Jobs |
| InvalidArgumentException |
Definition at line 159 of file JobQueueGroup.php.
References $cache, $job, $type, and push().
Referenced by lazyPush(), and push().
| JobQueueGroup::queuesHaveJobs | ( | $type = self::TYPE_ANY | ) |
Check if there are any queues with jobs (this is cached)
| int | $type | JobQueueGroup::TYPE_* constant |
Definition at line 359 of file JobQueueGroup.php.
References $cache, $type, getDefaultQueueTypes(), and getQueuesWithJobs().
|
static |
| bool | string | $domain | Wiki domain ID |
Definition at line 114 of file JobQueueGroup.php.
References wfDeprecated().
| JobQueueGroup::waitForBackups | ( | ) |
Wait for any replica DBs or backup queue servers to catch up.
This does nothing for certain queue classes.
Definition at line 327 of file JobQueueGroup.php.
References $type, and waitForBackups().
Referenced by waitForBackups().
|
protected |
Definition at line 40 of file JobQueueGroup.php.
|
protected |
Map of (bucket => (queue => JobQueue, types => list of types)
Definition at line 62 of file JobQueueGroup.php.
|
protected |
Wiki domain ID.
Definition at line 43 of file JobQueueGroup.php.
|
staticprotected |
Definition at line 37 of file JobQueueGroup.php.
|
protected |
Whether the wiki is not recognized in configuration.
Definition at line 47 of file JobQueueGroup.php.
|
protected |
Read only mode.
Definition at line 45 of file JobQueueGroup.php.
| const JobQueueGroup::TYPE_DEFAULT = 1 |
Definition at line 64 of file JobQueueGroup.php.
| const JobQueueGroup::USE_CACHE = 1 |
Definition at line 67 of file JobQueueGroup.php.