Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Client\Changes\InjectRCRecordsJob Class Reference

Job for injecting RecentChange records representing changes on the Wikibase repository. More...

+ Inheritance diagram for Wikibase\Client\Changes\InjectRCRecordsJob:
+ Collaboration diagram for Wikibase\Client\Changes\InjectRCRecordsJob:

Public Member Functions

 __construct (EntityChangeLookup $changeLookup, EntityChangeFactory $changeFactory, RecentChangeFactory $rcFactory, TitleFactory $titleFactory, array $params)
 Constructs an InjectRCRecordsJob for injecting a change into the recentchanges feed for the given pages.
 
 setRecentChangesFinder (RecentChangesFinder $rcDuplicateDetector)
 
 setLogger (LoggerInterface $logger)
 
 setStats (StatsdDataFactoryInterface $stats, StatsdDataFactoryInterface $perWikiStats=null)
 
 run ()
 

Static Public Member Functions

static makeJobSpecification (array $titles, EntityChange $change, array $rootJobParams=[])
 
static newFromGlobalState (Title $unused, array $params)
 

Private Member Functions

 getChange ()
 Returns the change that should be processed.
 
 getTitles ()
 
 incrementStats (string $updateType, int $delta)
 
 recordDelay (int $delay)
 

Private Attributes

 $changeLookup
 
 $changeFactory
 
 $rcFactory
 
 $rcDuplicateDetector = null
 
 $titleFactory
 
 $logger
 
 $stats = null
 
 $perWikiStats = null
 

Detailed Description

Job for injecting RecentChange records representing changes on the Wikibase repository.

See also
Change propagation for an overview of the change propagation mechanism.
Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\Changes\InjectRCRecordsJob::__construct ( EntityChangeLookup  $changeLookup,
EntityChangeFactory  $changeFactory,
RecentChangeFactory  $rcFactory,
TitleFactory  $titleFactory,
array  $params 
)

Constructs an InjectRCRecordsJob for injecting a change into the recentchanges feed for the given pages.

Parameters
EntityChangeLookup$changeLookup
EntityChangeFactory$changeFactory
RecentChangeFactory$rcFactory
TitleFactory$titleFactory
array$paramsNeeds to have two keys: "change": the id of the change, "pages": array of pages, represented as $pageId => [ $namespace, $dbKey ].
Exceptions
InvalidArgumentException

Member Function Documentation

◆ getChange()

Wikibase\Client\Changes\InjectRCRecordsJob::getChange ( )
private

Returns the change that should be processed.

EntityChange objects are loaded using a EntityChangeLookup.

Returns
EntityChange|null the change to process (or none).

◆ getTitles()

Wikibase\Client\Changes\InjectRCRecordsJob::getTitles ( )
private
Returns
Title[] List of Titles to inject RC entries for, indexed by page ID

◆ incrementStats()

Wikibase\Client\Changes\InjectRCRecordsJob::incrementStats ( string  $updateType,
int  $delta 
)
private
Parameters
string$updateType
int$delta

◆ makeJobSpecification()

static Wikibase\Client\Changes\InjectRCRecordsJob::makeJobSpecification ( array  $titles,
EntityChange  $change,
array  $rootJobParams = [] 
)
static
Parameters
Title[]$titles
EntityChange$change
array$rootJobParams
Returns
JobSpecification

◆ newFromGlobalState()

static Wikibase\Client\Changes\InjectRCRecordsJob::newFromGlobalState ( Title  $unused,
array  $params 
)
static

◆ recordDelay()

Wikibase\Client\Changes\InjectRCRecordsJob::recordDelay ( int  $delay)
private

◆ run()

Wikibase\Client\Changes\InjectRCRecordsJob::run ( )
Returns
bool success

◆ setLogger()

Wikibase\Client\Changes\InjectRCRecordsJob::setLogger ( LoggerInterface  $logger)

◆ setRecentChangesFinder()

Wikibase\Client\Changes\InjectRCRecordsJob::setRecentChangesFinder ( RecentChangesFinder  $rcDuplicateDetector)

◆ setStats()

Wikibase\Client\Changes\InjectRCRecordsJob::setStats ( StatsdDataFactoryInterface  $stats,
StatsdDataFactoryInterface  $perWikiStats = null 
)

Member Data Documentation

◆ $changeFactory

Wikibase\Client\Changes\InjectRCRecordsJob::$changeFactory
private

◆ $changeLookup

Wikibase\Client\Changes\InjectRCRecordsJob::$changeLookup
private

◆ $logger

Wikibase\Client\Changes\InjectRCRecordsJob::$logger
private

◆ $perWikiStats

Wikibase\Client\Changes\InjectRCRecordsJob::$perWikiStats = null
private

◆ $rcDuplicateDetector

Wikibase\Client\Changes\InjectRCRecordsJob::$rcDuplicateDetector = null
private

◆ $rcFactory

Wikibase\Client\Changes\InjectRCRecordsJob::$rcFactory
private

◆ $stats

Wikibase\Client\Changes\InjectRCRecordsJob::$stats = null
private

◆ $titleFactory

Wikibase\Client\Changes\InjectRCRecordsJob::$titleFactory
private

The documentation for this class was generated from the following file: