MediaWiki  REL1_19
RecompressTracked Class Reference

List of all members.

Public Member Functions

 __construct ($options)
 checkTrackingTable ()
 Make sure the tracking table exists and isn't empty.
 critical ($msg)
 debug ($msg)
 dispatch ()
 Dispatch a command to the next available slave.
 dispatchToSlave ($slaveId, $args)
 Dispatch a command to a specified slave.
 doAllOrphans ()
 Move all orphan text to the new clusters.
 doAllPages ()
 Move all tracked pages to the new clusters.
 doOrphanList ($textIds)
 Move an orphan text_id to the new cluster.
 doPage ($pageId)
 Move tracked text in a given page.
 execute ()
 Execute parent or child depending on the isChild option.
 executeChild ()
 Main entry point for worker processes.
 executeParent ()
 Execute the parent process.
 finishIncompleteMoves ($conds)
 Moves are done in two phases: bt_new_url and then bt_moved.
 getExtDB ($cluster)
 Gets a DB master connection for the given external cluster name.
 getTargetCluster ()
 Returns the name of the next target cluster.
 info ($msg)
 killSlaveProcs ()
 Gracefully terminate the child processes.
 logToFile ($msg, $file)
 moveTextRow ($textId, $url)
 Atomic move operation.
 report ($label, $current, $end)
 Display a progress report.
 startSlaveProcs ()
 Start the worker processes.
 syncDBs ()
 Wait until the selected slave has caught up to the master.
 waitForSlaves ()
 Wait for slaves (quietly)

Static Public Member Functions

static getOptionsWithArgs ()
static newFromCommandLine ($args, $options)

Public Attributes

 $batchSize = 1000
 $copyOnly = false
 $criticalLog
 $debugLog
 $destClusters
 $infoLog
 $isChild = false
 $noCount = false
 $numProcs = 1
 $orphanBatchSize = 1000
 $orphanBlobClass
 $pageBlobClass
 $prevSlaveId
 $reportingInterval = 10
 $slaveId = false
 $slavePipes
 $slaveProcs
 $store
 $useDiff

Static Public Attributes

static $cmdLineOptionMap
static $optionsWithArgs = array( 'procs', 'slave-id', 'debug-log', 'info-log', 'critical-log' )

Detailed Description

Definition at line 45 of file recompressTracked.php.


Constructor & Destructor Documentation

Definition at line 86 of file recompressTracked.php.

References $options.


Member Function Documentation

Make sure the tracking table exists and isn't empty.

Returns:
bool

Definition at line 174 of file recompressTracked.php.

References $dbr, critical(), info(), and wfGetDB().

Referenced by executeParent().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 116 of file recompressTracked.php.

References echo, and logToFile().

Referenced by checkTrackingTable(), dispatch(), doOrphanList(), doPage(), killSlaveProcs(), moveTextRow(), and startSlaveProcs().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 101 of file recompressTracked.php.

References logToFile(), and wfDebug().

Referenced by doOrphanList(), doPage(), executeChild(), and finishIncompleteMoves().

Here is the call graph for this function:

Here is the caller graph for this function:

Dispatch a command to the next available slave.

This may block until a slave finishes its work and becomes available.

Definition at line 251 of file recompressTracked.php.

References $slaveId, critical(), and dispatchToSlave().

Referenced by doAllPages().

Here is the call graph for this function:

Here is the caller graph for this function:

RecompressTracked::dispatchToSlave ( slaveId,
args 
)

Dispatch a command to a specified slave.

Definition at line 274 of file recompressTracked.php.

References $slaveId.

Referenced by dispatch(), and killSlaveProcs().

Here is the caller graph for this function:

Move all orphan text to the new clusters.

Definition at line 349 of file recompressTracked.php.

References $dbr, $res, info(), report(), and wfGetDB().

Referenced by executeParent().

Here is the call graph for this function:

Here is the caller graph for this function:

Move all tracked pages to the new clusters.

Definition at line 283 of file recompressTracked.php.

References $dbr, $res, dispatch(), info(), report(), and wfGetDB().

Referenced by executeParent().

Here is the call graph for this function:

Here is the caller graph for this function:

Move an orphan text_id to the new cluster.

Definition at line 615 of file recompressTracked.php.

References $res, critical(), debug(), finishIncompleteMoves(), Revision\getRevisionText(), syncDBs(), waitForSlaves(), and wfGetDB().

Referenced by executeChild().

Here is the call graph for this function:

Here is the caller graph for this function:

Move tracked text in a given page.

Definition at line 447 of file recompressTracked.php.

References $dbr, $res, $title, critical(), debug(), finishIncompleteMoves(), Revision\getRevisionText(), syncDBs(), waitForSlaves(), and wfGetDB().

Referenced by executeChild().

Here is the call graph for this function:

Here is the caller graph for this function:

Execute parent or child depending on the isChild option.

Definition at line 147 of file recompressTracked.php.

References executeChild(), and executeParent().

Here is the call graph for this function:

Main entry point for worker processes.

Definition at line 418 of file recompressTracked.php.

References debug(), doOrphanList(), doPage(), syncDBs(), and waitForSlaves().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

Execute the parent process.

Definition at line 158 of file recompressTracked.php.

References checkTrackingTable(), doAllOrphans(), doAllPages(), killSlaveProcs(), startSlaveProcs(), and syncDBs().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

Moves are done in two phases: bt_new_url and then bt_moved.

  • bt_new_url indicates that the text has been copied to the new cluster.
  • bt_moved indicates that the text table has been updated.

This function completes any moves that only have done bt_new_url. This can happen when the script is interrupted, or when --copy-only is used.

Definition at line 558 of file recompressTracked.php.

References $dbr, $res, debug(), moveTextRow(), waitForSlaves(), and wfGetDB().

Referenced by doOrphanList(), and doPage().

Here is the call graph for this function:

Here is the caller graph for this function:

Gets a DB master connection for the given external cluster name.

Parameters:
$clusterstring
Returns:
DatabaseBase

Definition at line 607 of file recompressTracked.php.

References $lb, and wfGetLBFactory().

Here is the call graph for this function:

Definition at line 72 of file recompressTracked.php.

References $optionsWithArgs.

Returns the name of the next target cluster.

Returns:
string

Definition at line 594 of file recompressTracked.php.

Definition at line 109 of file recompressTracked.php.

References echo, and logToFile().

Referenced by checkTrackingTable(), doAllOrphans(), doAllPages(), killSlaveProcs(), and report().

Here is the call graph for this function:

Here is the caller graph for this function:

Gracefully terminate the child processes.

Definition at line 233 of file recompressTracked.php.

References critical(), dispatchToSlave(), and info().

Referenced by executeParent().

Here is the call graph for this function:

Here is the caller graph for this function:

RecompressTracked::logToFile ( msg,
file 
)

Definition at line 123 of file recompressTracked.php.

References $file, wfErrorLog(), wfHostname(), and wfWikiID().

Referenced by critical(), debug(), and info().

Here is the call graph for this function:

Here is the caller graph for this function:

RecompressTracked::moveTextRow ( textId,
url 
)

Atomic move operation.

Write the new URL to the text table and set the bt_moved flag.

This is done in a single transaction to provide restartable behaviour without data loss.

The transaction is kept short to reduce locking.

Definition at line 525 of file recompressTracked.php.

References $url, critical(), and wfGetDB().

Referenced by finishIncompleteMoves().

Here is the call graph for this function:

Here is the caller graph for this function:

static RecompressTracked::newFromCommandLine ( args,
options 
) [static]

Definition at line 76 of file recompressTracked.php.

References $options.

RecompressTracked::report ( label,
current,
end 
)

Display a progress report.

Definition at line 337 of file recompressTracked.php.

References info(), and waitForSlaves().

Referenced by doAllOrphans(), and doAllPages().

Here is the call graph for this function:

Here is the caller graph for this function:

Start the worker processes.

These processes will listen on stdin for commands. This necessary because text recompression is slow: loading, compressing and writing are all slow.

Definition at line 194 of file recompressTracked.php.

References $optionsWithArgs, critical(), wfEscapeShellArg(), wfRestoreWarnings(), wfSuppressWarnings(), and wfWikiID().

Referenced by executeParent().

Here is the call graph for this function:

Here is the caller graph for this function:

Wait until the selected slave has caught up to the master.

This allows us to use the slave for things that were committed in a previous part of this batch process.

Definition at line 137 of file recompressTracked.php.

References $dbr, and wfGetDB().

Referenced by doOrphanList(), doPage(), executeChild(), and executeParent().

Here is the call graph for this function:

Here is the caller graph for this function:

Wait for slaves (quietly)

Definition at line 657 of file recompressTracked.php.

References $lb, and wfGetLB().

Referenced by doOrphanList(), doPage(), executeChild(), finishIncompleteMoves(), and report().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

RecompressTracked::$batchSize = 1000

Definition at line 47 of file recompressTracked.php.

RecompressTracked::$cmdLineOptionMap [static]
Initial value:
 array(
                'no-count' => 'noCount',
                'procs' => 'numProcs',
                'copy-only' => 'copyOnly',
                'child' => 'isChild',
                'slave-id' => 'slaveId',
                'debug-log' => 'debugLog',
                'info-log' => 'infoLog',
                'critical-log' => 'criticalLog',
        )

Definition at line 61 of file recompressTracked.php.

RecompressTracked::$copyOnly = false

Definition at line 53 of file recompressTracked.php.

RecompressTracked::$criticalLog

Definition at line 57 of file recompressTracked.php.

RecompressTracked::$debugLog

Definition at line 57 of file recompressTracked.php.

RecompressTracked::$destClusters

Definition at line 46 of file recompressTracked.php.

RecompressTracked::$infoLog

Definition at line 57 of file recompressTracked.php.

RecompressTracked::$isChild = false

Definition at line 54 of file recompressTracked.php.

RecompressTracked::$noCount = false

Definition at line 56 of file recompressTracked.php.

RecompressTracked::$numProcs = 1

Definition at line 50 of file recompressTracked.php.

RecompressTracked::$optionsWithArgs = array( 'procs', 'slave-id', 'debug-log', 'info-log', 'critical-log' ) [static]

Definition at line 60 of file recompressTracked.php.

Referenced by getOptionsWithArgs().

RecompressTracked::$orphanBatchSize = 1000

Definition at line 48 of file recompressTracked.php.

RecompressTracked::$orphanBlobClass

Definition at line 51 of file recompressTracked.php.

RecompressTracked::$pageBlobClass

Definition at line 51 of file recompressTracked.php.

RecompressTracked::$prevSlaveId

Definition at line 52 of file recompressTracked.php.

RecompressTracked::$reportingInterval = 10

Definition at line 49 of file recompressTracked.php.

RecompressTracked::$slaveId = false

Definition at line 55 of file recompressTracked.php.

Referenced by dispatch(), and dispatchToSlave().

RecompressTracked::$slavePipes

Definition at line 52 of file recompressTracked.php.

RecompressTracked::$slaveProcs

Definition at line 52 of file recompressTracked.php.

RecompressTracked::$store

Definition at line 58 of file recompressTracked.php.

RecompressTracked::$useDiff

Definition at line 51 of file recompressTracked.php.


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