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

Cirrus helpful extensions to Maintenance. More...

+ Inheritance diagram for CirrusSearch\Maintenance\Maintenance:
+ Collaboration diagram for CirrusSearch\Maintenance\Maintenance:

Public Member Functions

 finalSetup (SettingsBuilder $settingsBuilder)
 
 runChild ( $maintClass, $classFile=null)
 
 getConnection ( $cluster=null)
 
 getSearchConfig ()
 
 getMetaStore (Connection $conn=null)
 
 loadSpecialVars ()
 Execute a callback function at the end of initialisation.
 
 done ()
 Call to signal that execution of this maintenance script is complete so the next one gets the right indentation.
 
 output ( $message, $channel=null)
 
 outputIndented ( $message)
 
 error ( $err, $die=0)
 

Protected Member Functions

 disablePoolCountersAndLogging ()
 Disable all pool counters and cirrus query logs.
 
 maybeCreateMetastore ()
 Create metastore only if the alias does not already exist.
 
 requireCirrusReady ()
 
 getBackCompatOption (string $current, string $bc, bool $required=true)
 Provides support for backward compatible CLI options.
 
 unwrap (Status $status)
 Helper method for Status returning methods, such as via ConfigUtils.
 

Static Protected Attributes

static $indent = null
 

Detailed Description

Cirrus helpful extensions to Maintenance.

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

Member Function Documentation

◆ disablePoolCountersAndLogging()

CirrusSearch\Maintenance\Maintenance::disablePoolCountersAndLogging ( )
protected

Disable all pool counters and cirrus query logs.

Only useful for maint scripts

Ideally this method could be run in the constructor but apparently globals are reset just before the call to execute()

◆ error()

CirrusSearch\Maintenance\Maintenance::error ( $err,
$die = 0 )
Parameters
string$err
int$diedeprecated, do not use

Implements CirrusSearch\Maintenance\Printer.

Reimplemented in CirrusSearch\Maintenance\SaneitizeJobs.

◆ getBackCompatOption()

CirrusSearch\Maintenance\Maintenance::getBackCompatOption ( string $current,
string $bc,
bool $required = true )
protected

Provides support for backward compatible CLI options.

Requires either one or neither of the two options to be provided.

Parameters
string$currentThe current option to request
string$bcThe old option to provide BC support for
bool$requiredTrue if the option must be provided. When false and no option is provided null is returned.
Returns
mixed

◆ getConnection()

CirrusSearch\Maintenance\Maintenance::getConnection ( $cluster = null)
Parameters
string | null$cluster
Returns
Connection

◆ maybeCreateMetastore()

CirrusSearch\Maintenance\Maintenance::maybeCreateMetastore ( )
protected

Create metastore only if the alias does not already exist.

Returns
MetaStoreIndex

◆ output()

CirrusSearch\Maintenance\Maintenance::output ( $message,
$channel = null )
Parameters
string$message
string | null$channel

Implements CirrusSearch\Maintenance\Printer.

Reimplemented in CirrusSearch\Maintenance\DumpIndex.

◆ outputIndented()

CirrusSearch\Maintenance\Maintenance::outputIndented ( $message)

◆ runChild()

CirrusSearch\Maintenance\Maintenance::runChild ( $maintClass,
$classFile = null )
Parameters
string$maintClass
string | null$classFile
Returns
\Maintenance

◆ unwrap()

CirrusSearch\Maintenance\Maintenance::unwrap ( Status $status)
protected

Helper method for Status returning methods, such as via ConfigUtils.

Parameters
Status$status
Returns
mixed

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