[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/jobqueue/ -> JobQueueFederated.php (summary)

Job queue code for federated queues. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Author: Aaron Schulz
File Size: 559 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

JobQueueFederated:: (28 methods):
  __construct()
  supportedOrders()
  optimalOrder()
  supportsDelayedJobs()
  doIsEmpty()
  doGetSize()
  doGetAcquiredCount()
  doGetDelayedCount()
  doGetAbandonedCount()
  getCrossPartitionSum()
  doBatchPush()
  tryJobInsertions()
  doPop()
  doAck()
  doIsRootJobOldDuplicate()
  doDeduplicateRootJob()
  doDelete()
  doWaitForBackups()
  doGetPeriodicTasks()
  doFlushCaches()
  getAllQueuedJobs()
  getAllDelayedJobs()
  getCoalesceLocationInternal()
  doGetSiblingQueuesWithJobs()
  doGetSiblingQueueSizes()
  throwErrorIfAllPartitionsDown()
  setTestingPrefix()
  getCacheKey()


Class: JobQueueFederated  - X-Ref

Class to handle enqueueing and running of background jobs for federated queues

This class allows for queues to be partitioned into smaller queues.
A partition is defined by the configuration for a JobQueue instance.
For example, one can set $wgJobTypeConf['refreshLinks'] to point to a
JobQueueFederated instance, which itself would consist of three JobQueueRedis
instances, each using their own redis server. This would allow for the jobs
to be split (evenly or based on weights) accross multiple servers if a single
server becomes impractical or expensive. Different JobQueue classes can be mixed.

The basic queue configuration (e.g. "order", "claimTTL") of a federated queue
is inherited by the partition queues. Additional configuration defines what
section each wiki is in, what partition queues each section uses (and their weight),
and the JobQueue configuration for each partition. Some sections might only need a
single queue partition, like the sections for groups of small wikis.

If used for performance, then $wgMainCacheType should be set to memcached/redis.
Note that "fifo" cannot be used for the ordering, since the data is distributed.
One can still use "timestamp" instead, as in "roughly timestamp ordered". Also,
queue classes used by this should ignore down servers (with TTL) to avoid slowness.

__construct( array $params )   X-Ref

param: array $params Possible keys:

supportedOrders()   X-Ref
No description

optimalOrder()   X-Ref
No description

supportsDelayedJobs()   X-Ref
No description

doIsEmpty()   X-Ref
No description

doGetSize()   X-Ref
No description

doGetAcquiredCount()   X-Ref
No description

doGetDelayedCount()   X-Ref
No description

doGetAbandonedCount()   X-Ref
No description

getCrossPartitionSum( $type, $method )   X-Ref

param: string $type
param: string $method
return: int

doBatchPush( array $jobs, $flags )   X-Ref
No description

tryJobInsertions( array $jobs, HashRing &$partitionRing, $flags )   X-Ref

param: array $jobs
param: HashRing $partitionRing
param: int $flags
return: array List of Job object that could not be inserted

doPop()   X-Ref
No description

doAck( Job $job )   X-Ref
No description

doIsRootJobOldDuplicate( Job $job )   X-Ref
No description

doDeduplicateRootJob( Job $job )   X-Ref
No description

doDelete()   X-Ref
No description

doWaitForBackups()   X-Ref
No description

doGetPeriodicTasks()   X-Ref
No description

doFlushCaches()   X-Ref
No description

getAllQueuedJobs()   X-Ref
No description

getAllDelayedJobs()   X-Ref
No description

getCoalesceLocationInternal()   X-Ref
No description

doGetSiblingQueuesWithJobs( array $types )   X-Ref
No description

doGetSiblingQueueSizes( array $types )   X-Ref
No description

throwErrorIfAllPartitionsDown( $down )   X-Ref
Throw an error if no partitions available

param: int $down The number of up partitions down
return: void

setTestingPrefix( $key )   X-Ref
No description

getCacheKey( $property )   X-Ref

param: string $property
return: string



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1