Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\ChangePruner Class Reference

Handles pruning wb_changes table, used by pruneChanges maintenance script. More...

Public Member Functions

 __construct (ILBFactory $lbFactory, $batchSize, $keepSeconds, $graceSeconds, $ignoreDispatch)
 
 prune ()
 Prunes the wb_changes table. More...
 
 getMessageReporter ()
 
 setMessageReporter (MessageReporter $messageReporter)
 

Private Member Functions

 getCutoffTimestamp ()
 Calculates the timestamp up to which changes can be pruned. More...
 
 limitCutoffTimestamp ( $until)
 Changes the cutoff timestamp to not affect more than $this->batchSize rows, if needed. More...
 
 pruneChanges ( $until)
 Prunes all changes older than $until from the changes table. More...
 

Private Attributes

 $lbFactory
 
 $batchSize
 
 $keepSeconds
 
 $graceSeconds
 
 $ignoreDispatch
 
 $messageReporter
 

Detailed Description

Handles pruning wb_changes table, used by pruneChanges maintenance script.

Author
Katie Filbert < aude..nosp@m.wiki.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\ChangePruner::__construct ( ILBFactory  $lbFactory,
  $batchSize,
  $keepSeconds,
  $graceSeconds,
  $ignoreDispatch 
)
Parameters
ILBFactory$lbFactory
int$batchSize
int$keepSeconds
int$graceSeconds
bool$ignoreDispatch
Exceptions
InvalidArgumentException

Member Function Documentation

◆ getCutoffTimestamp()

Wikibase\Repo\ChangePruner::getCutoffTimestamp ( )
private

Calculates the timestamp up to which changes can be pruned.

Returns
string Timestamp up to which changes can be pruned (as MediaWiki concatenated string timestamp).

◆ getMessageReporter()

Wikibase\Repo\ChangePruner::getMessageReporter ( )
Returns
MessageReporter

◆ limitCutoffTimestamp()

Wikibase\Repo\ChangePruner::limitCutoffTimestamp (   $until)
private

Changes the cutoff timestamp to not affect more than $this->batchSize rows, if needed.

Parameters
string$untilMediaWiki concatenated string timestamp
Returns
string MediaWiki concatenated string timestamp

◆ prune()

Wikibase\Repo\ChangePruner::prune ( )

Prunes the wb_changes table.

◆ pruneChanges()

Wikibase\Repo\ChangePruner::pruneChanges (   $until)
private

Prunes all changes older than $until from the changes table.

Parameters
string$untilMediaWiki concatenated string timestamp
Returns
int the number of changes deleted.

◆ setMessageReporter()

Wikibase\Repo\ChangePruner::setMessageReporter ( MessageReporter  $messageReporter)

Member Data Documentation

◆ $batchSize

Wikibase\Repo\ChangePruner::$batchSize
private

◆ $graceSeconds

Wikibase\Repo\ChangePruner::$graceSeconds
private

◆ $ignoreDispatch

Wikibase\Repo\ChangePruner::$ignoreDispatch
private

◆ $keepSeconds

Wikibase\Repo\ChangePruner::$keepSeconds
private

◆ $lbFactory

Wikibase\Repo\ChangePruner::$lbFactory
private

◆ $messageReporter

Wikibase\Repo\ChangePruner::$messageReporter
private

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