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

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. More...

Public Member Functions

 __construct (Client $client, Printer $out)
 
 checkElasticsearchVersion ()
 
 pickIndexIdentifierFromOption ( $option, $typeName)
 Pick the index identifier from the provided command line option.
 
 getAllIndicesByType ( $typeName)
 Scan the indices and return the ones that match the type $typeName.
 
 scanAvailablePlugins (array $bannedPlugins=[])
 
 scanAvailableModules ()
 
 waitForGreen ( $indexName, $timeout)
 Wait for the index to go green.
 
 isIndex ( $indexName)
 Checks if this is an index (not an alias)
 
 getIndicesWithAlias ( $aliasName)
 Return a list of index names that points to $aliasName.
 
 isIndexLive ( $indexName)
 Returns true is this is an index thats never been unsed.
 

Protected Member Functions

 output ( $message, $channel=null)
 
 outputIndented ( $message)
 

Detailed Description

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\Maintenance\ConfigUtils::__construct ( Client $client,
Printer $out )
Parameters
Client$client
Printer$out

Member Function Documentation

◆ getAllIndicesByType()

CirrusSearch\Maintenance\ConfigUtils::getAllIndicesByType ( $typeName)

Scan the indices and return the ones that match the type $typeName.

Parameters
string$typeNamethe type to filter with
Returns
Status holds string[] with list of indices

◆ getIndicesWithAlias()

CirrusSearch\Maintenance\ConfigUtils::getIndicesWithAlias ( $aliasName)

Return a list of index names that points to $aliasName.

Parameters
string$aliasName
Returns
Status holds string[] with index names

◆ isIndex()

CirrusSearch\Maintenance\ConfigUtils::isIndex ( $indexName)

Checks if this is an index (not an alias)

Parameters
string$indexName
Returns
Status holds true if this is an index, false if it's an alias or if unknown

◆ isIndexLive()

CirrusSearch\Maintenance\ConfigUtils::isIndexLive ( $indexName)

Returns true is this is an index thats never been unsed.

Used as a pre-check when deleting indices. This checks that there are no aliases pointing at it, as all traffic flows through aliases. It additionally checks the index stats to verify it's never been queried.

$indexName should be an index and it should exist. If it is an alias or the index does not exist a fatal status will be returned.

Parameters
string$indexNameThe specific name of the index
Returns
Status When ok, contains true if the index is unused or false otherwise. When not good indicates some sort of communication error with elasticsearch.

◆ output()

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

◆ outputIndented()

CirrusSearch\Maintenance\ConfigUtils::outputIndented ( $message)
protected
Parameters
string$message

◆ pickIndexIdentifierFromOption()

CirrusSearch\Maintenance\ConfigUtils::pickIndexIdentifierFromOption ( $option,
$typeName )

Pick the index identifier from the provided command line option.

Parameters
string$optioncommand line option 'now' => current time 'current' => if there is just one index for this type then use its identifier other string => that string back
string$typeName
Returns
Status holds string index identifier to use

◆ scanAvailableModules()

CirrusSearch\Maintenance\ConfigUtils::scanAvailableModules ( )
Returns
Status holds string[]

◆ scanAvailablePlugins()

CirrusSearch\Maintenance\ConfigUtils::scanAvailablePlugins ( array $bannedPlugins = [])
Parameters
string[]$bannedPlugins
Returns
Status holds string[]

◆ waitForGreen()

CirrusSearch\Maintenance\ConfigUtils::waitForGreen ( $indexName,
$timeout )

Wait for the index to go green.

Parameters
string$indexName
int$timeout
Returns
bool true if the index is green false otherwise.

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