CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\Job\ElasticaWrite Class Reference

Performs writes to elasticsearch indexes with requeuing and an exponential backoff (if supported by jobqueue) when the index writes fail. More...

+ Inheritance diagram for CirrusSearch\Job\ElasticaWrite:
+ Collaboration diagram for CirrusSearch\Job\ElasticaWrite:

Public Member Functions

 __construct (array $params)
 Entry point for jobs received from the job queue.
 
 allowRetries ()
 This job handles all its own retries internally.
 
- Public Member Functions inherited from CirrusSearch\Job\CirrusGenericJob
 getSearchConfig ()
 

Static Public Member Functions

static build (ClusterSettings $cluster, string $method, array $arguments, array $params=[])
 

Protected Member Functions

 doJob ()
 

Additional Inherited Members

- Protected Attributes inherited from CirrusSearch\Job\CirrusGenericJob
 $searchConfig
 

Detailed Description

Performs writes to elasticsearch indexes with requeuing and an exponential backoff (if supported by jobqueue) when the index writes fail.

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.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html

Constructor & Destructor Documentation

◆ __construct()

CirrusSearch\Job\ElasticaWrite::__construct ( array $params)

Entry point for jobs received from the job queue.

Creating new jobs should be done via self::build.

Parameters
array$params

Reimplemented from CirrusSearch\Job\CirrusGenericJob.

Member Function Documentation

◆ allowRetries()

CirrusSearch\Job\ElasticaWrite::allowRetries ( )

This job handles all its own retries internally.

These jobs are so numerous that if they were to start failing they would possibly overflow the job queue and bring down redis in production.

Basically we just can't let these jobs hang out in the abandoned queue for a week like retries typically do. If these jobs get failed they will log to CirrusSearchChangeFailed which is a signal that some point in time around the failure needs to be reindexed manually. See https://wikitech.wikimedia.org/wiki/Search for more details.

Returns
bool

◆ build()

static CirrusSearch\Job\ElasticaWrite::build ( ClusterSettings $cluster,
string $method,
array $arguments,
array $params = [] )
static
Parameters
ClusterSettings$cluster
string$method
array$arguments
array$params
Returns
ElasticaWrite

◆ doJob()

CirrusSearch\Job\ElasticaWrite::doJob ( )
protected
Returns
bool

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