Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Store\Sql\PropertyInfoTableBuilder Class Reference

Utility class for rebuilding the wb_property_info table. More...

Public Member Functions

 __construct (PropertyInfoTable $propertyInfoTable, PropertyLookup $propertyLookup, PropertyInfoBuilder $propertyInfoBuilder, EntityIdComposer $entityIdComposer, EntityNamespaceLookup $entityNamespaceLookup)
 
 setRebuildAll ( $all)
 
 setBatchSize ( $batchSize)
 
 setReporter (MessageReporter $reporter)
 Sets the reporter to use for reporting progress.
 
 setUseTransactions ( $useTransactions)
 Enables or disables transactions.
 
 rebuildPropertyInfo ()
 Rebuild the property info entries.
 

Private Member Functions

 updatePropertyInfo (PropertyId $id)
 Updates the property info entry for the given property.
 
 reportMessage ( $msg)
 

Private Attributes

 $propertyInfoTable
 
 $propertyLookup
 
 $propertyInfoBuilder
 
 $entityIdComposer
 
 $entityNamespaceLookup
 
 $reporter = null
 
 $useTransactions = true
 
 $shouldUpdateAllEntities = false
 
 $batchSize = 100
 

Detailed Description

Utility class for rebuilding the wb_property_info table.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Store\Sql\PropertyInfoTableBuilder::__construct ( PropertyInfoTable  $propertyInfoTable,
PropertyLookup  $propertyLookup,
PropertyInfoBuilder  $propertyInfoBuilder,
EntityIdComposer  $entityIdComposer,
EntityNamespaceLookup  $entityNamespaceLookup 
)

Member Function Documentation

◆ rebuildPropertyInfo()

Wikibase\Repo\Store\Sql\PropertyInfoTableBuilder::rebuildPropertyInfo ( )

Rebuild the property info entries.

Use the rebuildPropertyInfo.php maintenance script to invoke this from the command line.

Database updates a batched into multiple transactions. Do not call this method within an (explicit) database transaction.

◆ reportMessage()

Wikibase\Repo\Store\Sql\PropertyInfoTableBuilder::reportMessage (   $msg)
private
Parameters
string$msg

◆ setBatchSize()

Wikibase\Repo\Store\Sql\PropertyInfoTableBuilder::setBatchSize (   $batchSize)
Parameters
int$batchSize

◆ setRebuildAll()

Wikibase\Repo\Store\Sql\PropertyInfoTableBuilder::setRebuildAll (   $all)
Parameters
bool$all

◆ setReporter()

Wikibase\Repo\Store\Sql\PropertyInfoTableBuilder::setReporter ( MessageReporter  $reporter)

Sets the reporter to use for reporting progress.

Parameters
MessageReporter$reporter

◆ setUseTransactions()

Wikibase\Repo\Store\Sql\PropertyInfoTableBuilder::setUseTransactions (   $useTransactions)

Enables or disables transactions.

The only good reason to disable transactions is to be able to run the rebuild inside an already existing transaction.

Parameters
bool$useTransactions

◆ updatePropertyInfo()

Wikibase\Repo\Store\Sql\PropertyInfoTableBuilder::updatePropertyInfo ( PropertyId  $id)
private

Updates the property info entry for the given property.

The property is loaded in full using the EntityLookup provide to the constructor.

Exceptions
RuntimeException
Parameters
PropertyId$idthe Property to process

Member Data Documentation

◆ $batchSize

Wikibase\Repo\Store\Sql\PropertyInfoTableBuilder::$batchSize = 100
private

◆ $entityIdComposer

Wikibase\Repo\Store\Sql\PropertyInfoTableBuilder::$entityIdComposer
private

◆ $entityNamespaceLookup

Wikibase\Repo\Store\Sql\PropertyInfoTableBuilder::$entityNamespaceLookup
private

◆ $propertyInfoBuilder

Wikibase\Repo\Store\Sql\PropertyInfoTableBuilder::$propertyInfoBuilder
private

◆ $propertyInfoTable

Wikibase\Repo\Store\Sql\PropertyInfoTableBuilder::$propertyInfoTable
private

◆ $propertyLookup

Wikibase\Repo\Store\Sql\PropertyInfoTableBuilder::$propertyLookup
private

◆ $reporter

Wikibase\Repo\Store\Sql\PropertyInfoTableBuilder::$reporter = null
private

◆ $shouldUpdateAllEntities

Wikibase\Repo\Store\Sql\PropertyInfoTableBuilder::$shouldUpdateAllEntities = false
private

◆ $useTransactions

Wikibase\Repo\Store\Sql\PropertyInfoTableBuilder::$useTransactions = true
private

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