MediaWiki  1.23.2
JobQueueFederated.php
Go to the documentation of this file.
1 <?php
49 class JobQueueFederated extends JobQueue {
51  protected $partitionMap = array();
52 
54  protected $partitionQueues = array();
55 
57  protected $partitionPushRing;
58 
60  protected $cache;
61 
63  protected $maxPartitionsTry;
64 
65  const CACHE_TTL_SHORT = 30; // integer; seconds to cache info without re-validating
66  const CACHE_TTL_LONG = 300; // integer; seconds to cache info that is kept up to date
67 
88  protected function __construct( array $params ) {
89  parent::__construct( $params );
90  $section = isset( $params['sectionsByWiki'][$this->wiki] )
91  ? $params['sectionsByWiki'][$this->wiki]
92  : 'default';
93  if ( !isset( $params['partitionsBySection'][$section] ) ) {
94  throw new MWException( "No configuration for section '$section'." );
95  }
96  $this->maxPartitionsTry = isset( $params['maxPartitionsTry'] )
97  ? $params['maxPartitionsTry']
98  : 2;
99  // Get the full partition map
100  $this->partitionMap = $params['partitionsBySection'][$section];
101  arsort( $this->partitionMap, SORT_NUMERIC );
102  // Get the partitions jobs can actually be pushed to
103  $partitionPushMap = $this->partitionMap;
104  if ( isset( $params['partitionsNoPush'] ) ) {
105  foreach ( $params['partitionsNoPush'] as $partition ) {
106  unset( $partitionPushMap[$partition] );
107  }
108  }
109  // Get the config to pass to merge into each partition queue config
110  $baseConfig = $params;
111  foreach ( array( 'class', 'sectionsByWiki', 'maxPartitionsTry',
112  'partitionsBySection', 'configByPartition', 'partitionsNoPush' ) as $o
113  ) {
114  unset( $baseConfig[$o] ); // partition queue doesn't care about this
115  }
116  // Get the partition queue objects
117  foreach ( $this->partitionMap as $partition => $w ) {
118  if ( !isset( $params['configByPartition'][$partition] ) ) {
119  throw new MWException( "No configuration for partition '$partition'." );
120  }
121  $this->partitionQueues[$partition] = JobQueue::factory(
122  $baseConfig + $params['configByPartition'][$partition] );
123  }
124  // Get the ring of partitions to push jobs into
125  $this->partitionPushRing = new HashRing( $partitionPushMap );
126  // Aggregate cache some per-queue values if there are multiple partition queues
127  $this->cache = count( $this->partitionMap ) > 1 ? wfGetMainCache() : new EmptyBagOStuff();
128  }
129 
130  protected function supportedOrders() {
131  // No FIFO due to partitioning, though "rough timestamp order" is supported
132  return array( 'undefined', 'random', 'timestamp' );
133  }
134 
135  protected function optimalOrder() {
136  return 'undefined'; // defer to the partitions
137  }
138 
139  protected function supportsDelayedJobs() {
140  return true; // defer checks to the partitions
141  }
142 
143  protected function doIsEmpty() {
144  $key = $this->getCacheKey( 'empty' );
145 
146  $isEmpty = $this->cache->get( $key );
147  if ( $isEmpty === 'true' ) {
148  return true;
149  } elseif ( $isEmpty === 'false' ) {
150  return false;
151  }
152 
153  $empty = true;
154  $failed = 0;
155  foreach ( $this->partitionQueues as $queue ) {
156  try {
157  $empty = $empty && $queue->doIsEmpty();
158  } catch ( JobQueueError $e ) {
159  ++$failed;
161  }
162  }
164 
165  $this->cache->add( $key, $empty ? 'true' : 'false', self::CACHE_TTL_LONG );
166  return $empty;
167  }
168 
169  protected function doGetSize() {
170  return $this->getCrossPartitionSum( 'size', 'doGetSize' );
171  }
172 
173  protected function doGetAcquiredCount() {
174  return $this->getCrossPartitionSum( 'acquiredcount', 'doGetAcquiredCount' );
175  }
176 
177  protected function doGetDelayedCount() {
178  return $this->getCrossPartitionSum( 'delayedcount', 'doGetDelayedCount' );
179  }
180 
181  protected function doGetAbandonedCount() {
182  return $this->getCrossPartitionSum( 'abandonedcount', 'doGetAbandonedCount' );
183  }
184 
190  protected function getCrossPartitionSum( $type, $method ) {
191  $key = $this->getCacheKey( $type );
192 
193  $count = $this->cache->get( $key );
194  if ( is_int( $count ) ) {
195  return $count;
196  }
197 
198  $failed = 0;
199  foreach ( $this->partitionQueues as $queue ) {
200  try {
201  $count += $queue->$method();
202  } catch ( JobQueueError $e ) {
203  ++$failed;
205  }
206  }
208 
209  $this->cache->set( $key, $count, self::CACHE_TTL_SHORT );
210 
211  return $count;
212  }
213 
214  protected function doBatchPush( array $jobs, $flags ) {
215  // Local ring variable that may be changed to point to a new ring on failure
216  $partitionRing = $this->partitionPushRing;
217  // Try to insert the jobs and update $partitionsTry on any failures.
218  // Retry to insert any remaning jobs again, ignoring the bad partitions.
219  $jobsLeft = $jobs;
220  for ( $i = $this->maxPartitionsTry; $i > 0 && count( $jobsLeft ); --$i ) {
221  $jobsLeft = $this->tryJobInsertions( $jobsLeft, $partitionRing, $flags );
222  }
223  if ( count( $jobsLeft ) ) {
224  throw new JobQueueError(
225  "Could not insert job(s), {$this->maxPartitionsTry} partitions tried." );
226  }
227 
228  return true;
229  }
230 
238  protected function tryJobInsertions( array $jobs, HashRing &$partitionRing, $flags ) {
239  $jobsLeft = array();
240 
241  // Because jobs are spread across partitions, per-job de-duplication needs
242  // to use a consistent hash to avoid allowing duplicate jobs per partition.
243  // When inserting a batch of de-duplicated jobs, QOS_ATOMIC is disregarded.
244  $uJobsByPartition = array(); // (partition name => job list)
246  foreach ( $jobs as $key => $job ) {
247  if ( $job->ignoreDuplicates() ) {
248  $sha1 = sha1( serialize( $job->getDeduplicationInfo() ) );
249  $uJobsByPartition[$partitionRing->getLocation( $sha1 )][] = $job;
250  unset( $jobs[$key] );
251  }
252  }
253  // Get the batches of jobs that are not de-duplicated
254  if ( $flags & self::QOS_ATOMIC ) {
255  $nuJobBatches = array( $jobs ); // all or nothing
256  } else {
257  // Split the jobs into batches and spread them out over servers if there
258  // are many jobs. This helps keep the partitions even. Otherwise, send all
259  // the jobs to a single partition queue to avoids the extra connections.
260  $nuJobBatches = array_chunk( $jobs, 300 );
261  }
262 
263  // Insert the de-duplicated jobs into the queues...
264  foreach ( $uJobsByPartition as $partition => $jobBatch ) {
266  $queue = $this->partitionQueues[$partition];
267  try {
268  $ok = $queue->doBatchPush( $jobBatch, $flags | self::QOS_ATOMIC );
269  } catch ( JobQueueError $e ) {
270  $ok = false;
272  }
273  if ( $ok ) {
274  $key = $this->getCacheKey( 'empty' );
275  $this->cache->set( $key, 'false', JobQueueDB::CACHE_TTL_LONG );
276  } else {
277  $partitionRing = $partitionRing->newWithoutLocation( $partition ); // blacklist
278  if ( !$partitionRing ) {
279  throw new JobQueueError( "Could not insert job(s), no partitions available." );
280  }
281  $jobsLeft = array_merge( $jobsLeft, $jobBatch ); // not inserted
282  }
283  }
284 
285  // Insert the jobs that are not de-duplicated into the queues...
286  foreach ( $nuJobBatches as $jobBatch ) {
287  $partition = ArrayUtils::pickRandom( $partitionRing->getLocationWeights() );
288  $queue = $this->partitionQueues[$partition];
289  try {
290  $ok = $queue->doBatchPush( $jobBatch, $flags | self::QOS_ATOMIC );
291  } catch ( JobQueueError $e ) {
292  $ok = false;
294  }
295  if ( $ok ) {
296  $key = $this->getCacheKey( 'empty' );
297  $this->cache->set( $key, 'false', JobQueueDB::CACHE_TTL_LONG );
298  } else {
299  $partitionRing = $partitionRing->newWithoutLocation( $partition ); // blacklist
300  if ( !$partitionRing ) {
301  throw new JobQueueError( "Could not insert job(s), no partitions available." );
302  }
303  $jobsLeft = array_merge( $jobsLeft, $jobBatch ); // not inserted
304  }
305  }
306 
307  return $jobsLeft;
308  }
309 
310  protected function doPop() {
311  $key = $this->getCacheKey( 'empty' );
312 
313  $isEmpty = $this->cache->get( $key );
314  if ( $isEmpty === 'true' ) {
315  return false;
316  }
317 
318  $partitionsTry = $this->partitionMap; // (partition => weight)
319 
320  $failed = 0;
321  while ( count( $partitionsTry ) ) {
322  $partition = ArrayUtils::pickRandom( $partitionsTry );
323  if ( $partition === false ) {
324  break; // all partitions at 0 weight
325  }
326 
328  $queue = $this->partitionQueues[$partition];
329  try {
330  $job = $queue->pop();
331  } catch ( JobQueueError $e ) {
332  ++$failed;
334  $job = false;
335  }
336  if ( $job ) {
337  $job->metadata['QueuePartition'] = $partition;
338 
339  return $job;
340  } else {
341  unset( $partitionsTry[$partition] ); // blacklist partition
342  }
343  }
345 
346  $this->cache->set( $key, 'true', JobQueueDB::CACHE_TTL_LONG );
347 
348  return false;
349  }
350 
351  protected function doAck( Job $job ) {
352  if ( !isset( $job->metadata['QueuePartition'] ) ) {
353  throw new MWException( "The given job has no defined partition name." );
354  }
355 
356  return $this->partitionQueues[$job->metadata['QueuePartition']]->ack( $job );
357  }
358 
359  protected function doIsRootJobOldDuplicate( Job $job ) {
360  $params = $job->getRootJobParams();
361  $partitions = $this->partitionPushRing->getLocations( $params['rootJobSignature'], 2 );
362  try {
363  return $this->partitionQueues[$partitions[0]]->doIsRootJobOldDuplicate( $job );
364  } catch ( JobQueueError $e ) {
365  if ( isset( $partitions[1] ) ) { // check fallback partition
366  return $this->partitionQueues[$partitions[1]]->doIsRootJobOldDuplicate( $job );
367  }
368  }
369 
370  return false;
371  }
372 
373  protected function doDeduplicateRootJob( Job $job ) {
374  $params = $job->getRootJobParams();
375  $partitions = $this->partitionPushRing->getLocations( $params['rootJobSignature'], 2 );
376  try {
377  return $this->partitionQueues[$partitions[0]]->doDeduplicateRootJob( $job );
378  } catch ( JobQueueError $e ) {
379  if ( isset( $partitions[1] ) ) { // check fallback partition
380  return $this->partitionQueues[$partitions[1]]->doDeduplicateRootJob( $job );
381  }
382  }
383 
384  return false;
385  }
386 
387  protected function doDelete() {
388  $failed = 0;
390  foreach ( $this->partitionQueues as $queue ) {
391  try {
392  $queue->doDelete();
393  } catch ( JobQueueError $e ) {
394  ++$failed;
396  }
397  }
399  return true;
400  }
401 
402  protected function doWaitForBackups() {
403  $failed = 0;
405  foreach ( $this->partitionQueues as $queue ) {
406  try {
407  $queue->waitForBackups();
408  } catch ( JobQueueError $e ) {
409  ++$failed;
411  }
412  }
414  }
415 
416  protected function doGetPeriodicTasks() {
417  $tasks = array();
419  foreach ( $this->partitionQueues as $partition => $queue ) {
420  foreach ( $queue->getPeriodicTasks() as $task => $def ) {
421  $tasks["{$partition}:{$task}"] = $def;
422  }
423  }
424 
425  return $tasks;
426  }
427 
428  protected function doFlushCaches() {
429  static $types = array(
430  'empty',
431  'size',
432  'acquiredcount',
433  'delayedcount',
434  'abandonedcount'
435  );
436 
437  foreach ( $types as $type ) {
438  $this->cache->delete( $this->getCacheKey( $type ) );
439  }
440 
442  foreach ( $this->partitionQueues as $queue ) {
443  $queue->doFlushCaches();
444  }
445  }
446 
447  public function getAllQueuedJobs() {
448  $iterator = new AppendIterator();
449 
451  foreach ( $this->partitionQueues as $queue ) {
452  $iterator->append( $queue->getAllQueuedJobs() );
453  }
454 
455  return $iterator;
456  }
457 
458  public function getAllDelayedJobs() {
459  $iterator = new AppendIterator();
460 
462  foreach ( $this->partitionQueues as $queue ) {
463  $iterator->append( $queue->getAllDelayedJobs() );
464  }
465 
466  return $iterator;
467  }
468 
469  public function getCoalesceLocationInternal() {
470  return "JobQueueFederated:wiki:{$this->wiki}" .
471  sha1( serialize( array_keys( $this->partitionMap ) ) );
472  }
473 
474  protected function doGetSiblingQueuesWithJobs( array $types ) {
475  $result = array();
476 
477  $failed = 0;
479  foreach ( $this->partitionQueues as $queue ) {
480  try {
481  $nonEmpty = $queue->doGetSiblingQueuesWithJobs( $types );
482  if ( is_array( $nonEmpty ) ) {
483  $result = array_unique( array_merge( $result, $nonEmpty ) );
484  } else {
485  return null; // not supported on all partitions; bail
486  }
487  if ( count( $result ) == count( $types ) ) {
488  break; // short-circuit
489  }
490  } catch ( JobQueueError $e ) {
491  ++$failed;
493  }
494  }
496 
497  return array_values( $result );
498  }
499 
500  protected function doGetSiblingQueueSizes( array $types ) {
501  $result = array();
502  $failed = 0;
504  foreach ( $this->partitionQueues as $queue ) {
505  try {
506  $sizes = $queue->doGetSiblingQueueSizes( $types );
507  if ( is_array( $sizes ) ) {
508  foreach ( $sizes as $type => $size ) {
509  $result[$type] = isset( $result[$type] ) ? $result[$type] + $size : $size;
510  }
511  } else {
512  return null; // not supported on all partitions; bail
513  }
514  } catch ( JobQueueError $e ) {
515  ++$failed;
517  }
518  }
520 
521  return $result;
522  }
523 
531  protected function throwErrorIfAllPartitionsDown( $down ) {
532  if ( $down >= count( $this->partitionQueues ) ) {
533  throw new JobQueueError( 'No queue partitions available.' );
534  }
535  }
536 
537  public function setTestingPrefix( $key ) {
539  foreach ( $this->partitionQueues as $queue ) {
540  $queue->setTestingPrefix( $key );
541  }
542  }
543 
548  private function getCacheKey( $property ) {
549  list( $db, $prefix ) = wfSplitWikiID( $this->wiki );
550 
551  return wfForeignMemcKey( $db, $prefix, 'jobqueue', $this->type, $property );
552  }
553 }
JobQueueFederated\CACHE_TTL_SHORT
const CACHE_TTL_SHORT
Definition: JobQueueFederated.php:60
$result
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. $reader:XMLReader object $logInfo:Array of information Return false to stop further processing of the tag 'ImportHandlePageXMLTag':When parsing a XML tag in a page. $reader:XMLReader object $pageInfo:Array of information Return false to stop further processing of the tag 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information Return false to stop further processing of the tag 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. $reader:XMLReader object Return false to stop further processing of the tag 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. $reader:XMLReader object $revisionInfo:Array of information Return false to stop further processing of the tag 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. $title:Title object for the current page $request:WebRequest $ignoreRedirect:boolean to skip redirect check $target:Title/string of redirect target $article:Article object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) $article:article(object) being checked 'IsTrustedProxy':Override the result of wfIsTrustedProxy() $ip:IP being check $result:Change this value to override the result of wfIsTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of User::isValidEmailAddr(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetMagic':DEPRECATED, use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetSpecialPageAliases':DEPRECATED, use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Associative array mapping language codes to prefixed links of the form "language:title". & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LinkBegin':Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
Definition: hooks.txt:1528
JobQueueFederated\$cache
BagOStuff $cache
Definition: JobQueueFederated.php:56
JobQueueDB\CACHE_TTL_LONG
const CACHE_TTL_LONG
Definition: JobQueueDB.php:32
JobQueueFederated\throwErrorIfAllPartitionsDown
throwErrorIfAllPartitionsDown( $down)
Throw an error if no partitions available.
Definition: JobQueueFederated.php:526
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
JobQueueFederated\doFlushCaches
doFlushCaches()
Definition: JobQueueFederated.php:423
JobQueueFederated\doPop
doPop()
Definition: JobQueueFederated.php:305
EmptyBagOStuff
A BagOStuff object with no objects in it.
Definition: EmptyBagOStuff.php:29
JobQueueFederated\doIsEmpty
doIsEmpty()
Definition: JobQueueFederated.php:138
JobQueueFederated\getCacheKey
getCacheKey( $property)
Definition: JobQueueFederated.php:543
wiki
Prior to maintenance scripts were a hodgepodge of code that had no cohesion or formal method of action Beginning maintenance scripts have been cleaned up to use a unified class Directory structure How to run a script How to write your own DIRECTORY STRUCTURE The maintenance directory of a MediaWiki installation contains several all of which have unique purposes HOW TO RUN A SCRIPT Ridiculously just call php someScript php that s in the top level maintenance directory if not default wiki
Definition: maintenance.txt:1
JobQueueFederated\$partitionPushRing
HashRing $partitionPushRing
Definition: JobQueueFederated.php:54
$params
$params
Definition: styleTest.css.php:40
JobQueueFederated\doGetDelayedCount
doGetDelayedCount()
Definition: JobQueueFederated.php:172
BagOStuff
interface is intended to be more or less compatible with the PHP memcached client.
Definition: BagOStuff.php:43
wfSplitWikiID
wfSplitWikiID( $wiki)
Split a wiki ID into DB name and table prefix.
Definition: GlobalFunctions.php:3620
JobQueueFederated\getCoalesceLocationInternal
getCoalesceLocationInternal()
Do not use this function outside of JobQueue/JobQueueGroup.
Definition: JobQueueFederated.php:464
JobQueueFederated\doIsRootJobOldDuplicate
doIsRootJobOldDuplicate(Job $job)
Definition: JobQueueFederated.php:354
JobQueueFederated\supportedOrders
supportedOrders()
Get the allowed queue orders for configuration validation.
Definition: JobQueueFederated.php:125
$flags
it s the revision text itself In either if gzip is the revision text is gzipped $flags
Definition: hooks.txt:2113
JobQueueFederated\setTestingPrefix
setTestingPrefix( $key)
Namespace the queue with a key to isolate it for testing.
Definition: JobQueueFederated.php:532
cache
you have access to all of the normal MediaWiki so you can get a DB use the cache
Definition: maintenance.txt:52
JobQueueFederated\getAllQueuedJobs
getAllQueuedJobs()
Get an iterator to traverse over all available jobs in this queue.
Definition: JobQueueFederated.php:442
HashRing\getLocation
getLocation( $item)
Get the location of an item on the ring.
Definition: HashRing.php:78
Job
Class to both describe a background job and handle jobs.
Definition: Job.php:31
JobQueueFederated\doGetPeriodicTasks
doGetPeriodicTasks()
Definition: JobQueueFederated.php:411
JobQueueFederated\doAck
doAck(Job $job)
Definition: JobQueueFederated.php:346
JobQueueFederated\doDelete
doDelete()
Definition: JobQueueFederated.php:382
HashRing\getLocationWeights
getLocationWeights()
Get the map of locations to weight (ignores 0-weight items)
Definition: HashRing.php:126
wfGetMainCache
wfGetMainCache()
Get the main cache object.
Definition: GlobalFunctions.php:3957
MWException
MediaWiki exception.
Definition: MWException.php:26
JobQueueFederated\doGetSiblingQueuesWithJobs
doGetSiblingQueuesWithJobs(array $types)
Definition: JobQueueFederated.php:469
$property
$property
Definition: styleTest.css.php:44
JobQueueFederated\tryJobInsertions
tryJobInsertions(array $jobs, HashRing &$partitionRing, $flags)
Definition: JobQueueFederated.php:233
JobQueueFederated\$partitionMap
array $partitionMap
(partition name => weight) reverse sorted by weight *
Definition: JobQueueFederated.php:50
JobQueueFederated\doGetSize
doGetSize()
Definition: JobQueueFederated.php:164
JobQueue\$type
string $type
Job type *.
Definition: JobQueue.php:34
JobQueueFederated\getAllDelayedJobs
getAllDelayedJobs()
Get an iterator to traverse over all delayed jobs in this queue.
Definition: JobQueueFederated.php:453
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
JobQueueFederated\doBatchPush
doBatchPush(array $jobs, $flags)
Definition: JobQueueFederated.php:209
JobQueueError
Definition: JobQueue.php:738
wfForeignMemcKey
wfForeignMemcKey( $db, $prefix)
Get a cache key for a foreign DB.
Definition: GlobalFunctions.php:3588
list
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Definition: deferred.txt:11
JobQueueFederated\getCrossPartitionSum
getCrossPartitionSum( $type, $method)
Definition: JobQueueFederated.php:185
$ok
$ok
Definition: UtfNormalTest.php:71
$section
$section
Definition: Utf8Test.php:88
$size
$size
Definition: RandomTest.php:75
JobQueueFederated\doGetSiblingQueueSizes
doGetSiblingQueueSizes(array $types)
Definition: JobQueueFederated.php:495
JobQueueFederated\$partitionQueues
array $partitionQueues
(partition name => JobQueue) reverse sorted by weight *
Definition: JobQueueFederated.php:52
JobQueue\factory
static factory(array $params)
Get a job queue object of the specified type.
Definition: JobQueue.php:105
$count
$count
Definition: UtfNormalTest2.php:96
JobQueue\$wiki
string $wiki
Wiki ID *.
Definition: JobQueue.php:32
type
This document describes the state of Postgres support in and is fairly well maintained The main code is very well while extensions are very hit and miss it is probably the most supported database after MySQL Much of the work in making MediaWiki database agnostic came about through the work of creating Postgres as and are nearing end of but without copying over all the usage comments General notes on the but these can almost always be programmed around *Although Postgres has a true BOOLEAN type
Definition: postgres.txt:22
ArrayUtils\pickRandom
static pickRandom( $weights)
Given an array of non-normalised probabilities, this function will select an element and return the a...
Definition: ArrayUtils.php:66
$job
if(count( $args)< 1) $job
Definition: recompressTracked.php:42
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
JobQueueFederated\$maxPartitionsTry
int $maxPartitionsTry
Maximum number of partitions to try *.
Definition: JobQueueFederated.php:58
JobQueueFederated\CACHE_TTL_LONG
const CACHE_TTL_LONG
Definition: JobQueueFederated.php:61
JobQueue
Class to handle enqueueing and running of background jobs.
Definition: JobQueue.php:31
JobQueueFederated\doGetAbandonedCount
doGetAbandonedCount()
Definition: JobQueueFederated.php:176
JobQueueFederated\__construct
__construct(array $params)
@params include:
Definition: JobQueueFederated.php:83
MWExceptionHandler\logException
static logException(Exception $e)
Log an exception to the exception log (if enabled).
Definition: MWExceptionHandler.php:351
JobQueueFederated\doWaitForBackups
doWaitForBackups()
Definition: JobQueueFederated.php:397
JobQueueFederated\doDeduplicateRootJob
doDeduplicateRootJob(Job $job)
Definition: JobQueueFederated.php:368
JobQueueFederated\optimalOrder
optimalOrder()
Get the default queue order to use if configuration does not specify one.
Definition: JobQueueFederated.php:130
$e
if( $useReadline) $e
Definition: eval.php:66
HashRing
Convenience class for weighted consistent hash rings.
Definition: HashRing.php:29
$failed
$failed
Definition: Utf8Test.php:90
JobQueueFederated\doGetAcquiredCount
doGetAcquiredCount()
Definition: JobQueueFederated.php:168
JobQueueFederated
Class to handle enqueueing and running of background jobs for federated queues.
Definition: JobQueueFederated.php:49
JobQueueFederated\supportsDelayedJobs
supportsDelayedJobs()
Find out if delayed jobs are supported for configuration validation.
Definition: JobQueueFederated.php:134
HashRing\newWithoutLocation
newWithoutLocation( $location)
Get a new hash ring with a location removed from the ring.
Definition: HashRing.php:136