RecompressTracked Class Reference

List of all members.

Public Member Functions

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

Static Public Member Functions

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

Public Attributes

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

Static Public Attributes

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


Detailed Description

Definition at line 23 of file recompressTracked.php.


Constructor & Destructor Documentation

RecompressTracked::__construct ( options  ) 

Definition at line 62 of file recompressTracked.php.

References $GLOBALS, $name, and $options.


Member Function Documentation

RecompressTracked::checkTrackingTable (  ) 

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

Definition at line 149 of file recompressTracked.php.

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

Referenced by executeParent().

RecompressTracked::critical ( msg  ) 

RecompressTracked::debug ( msg  ) 

Definition at line 77 of file recompressTracked.php.

References $msg, logToFile(), and wfDebug().

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

RecompressTracked::dispatch (  ) 

Dispatch a command to the next available slave.

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

Definition at line 226 of file recompressTracked.php.

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

Referenced by doAllPages().

RecompressTracked::dispatchToSlave ( slaveId,
args 
)

Dispatch a command to a specified slave.

Definition at line 249 of file recompressTracked.php.

References $args, $cmd, and $slaveId.

Referenced by dispatch(), and killSlaveProcs().

RecompressTracked::doAllOrphans (  ) 

Move all orphan text to the new clusters.

Definition at line 320 of file recompressTracked.php.

References $args, $dbr, $i, $res, $row, $startId, info(), report(), and wfGetDB().

Referenced by executeParent().

RecompressTracked::doAllPages (  ) 

Move all tracked pages to the new clusters.

Definition at line 258 of file recompressTracked.php.

References $dbr, $i, $res, $row, $startId, dispatch(), info(), is(), report(), and wfGetDB().

Referenced by executeParent().

RecompressTracked::doOrphanList ( textIds  ) 

Move an orphan text_id to the new cluster.

Definition at line 575 of file recompressTracked.php.

References $res, $row, $text, critical(), debug(), finishIncompleteMoves(), Revision::getRevisionText(), syncDBs(), and wfGetDB().

Referenced by executeChild().

RecompressTracked::doPage ( pageId  ) 

Move tracked text in a given page.

Definition at line 414 of file recompressTracked.php.

References $dbr, $res, $row, $startId, $text, $title, critical(), debug(), finishIncompleteMoves(), Revision::getRevisionText(), syncDBs(), and wfGetDB().

Referenced by executeChild().

RecompressTracked::execute (  ) 

Execute parent or child depending on the isChild option.

Definition at line 123 of file recompressTracked.php.

References executeChild(), and executeParent().

RecompressTracked::executeChild (  ) 

Main entry point for worker processes.

Definition at line 385 of file recompressTracked.php.

References $args, $cmd, debug(), doOrphanList(), doPage(), syncDBs(), and wfWaitForSlaves().

Referenced by execute().

RecompressTracked::executeParent (  ) 

Execute the parent process.

Definition at line 134 of file recompressTracked.php.

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

Referenced by execute().

RecompressTracked::finishIncompleteMoves ( conds  ) 

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 524 of file recompressTracked.php.

References $conds, $dbr, $res, $row, $startId, debug(), moveTextRow(), and wfGetDB().

Referenced by doOrphanList(), and doPage().

RecompressTracked::getExtDB ( cluster  ) 

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

Definition at line 567 of file recompressTracked.php.

References $lb, and wfGetLBFactory().

static RecompressTracked::getOptionsWithArgs (  )  [static]

Definition at line 48 of file recompressTracked.php.

References $optionsWithArgs.

RecompressTracked::getTargetCluster (  ) 

Returns the name of the next target cluster.

Definition at line 556 of file recompressTracked.php.

RecompressTracked::info ( msg  ) 

Definition at line 85 of file recompressTracked.php.

References $msg, and logToFile().

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

RecompressTracked::killSlaveProcs (  ) 

Gracefully terminate the child processes.

Definition at line 208 of file recompressTracked.php.

References $i, $status, critical(), dispatchToSlave(), and info().

Referenced by executeParent().

RecompressTracked::logToFile ( msg,
file 
)

Definition at line 99 of file recompressTracked.php.

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

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

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 491 of file recompressTracked.php.

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

Referenced by finishIncompleteMoves().

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

Definition at line 52 of file recompressTracked.php.

References $args, and $options.

RecompressTracked::report ( label,
current,
end 
)

Display a progress report.

Definition at line 308 of file recompressTracked.php.

References $end, info(), and wfWaitForSlaves().

Referenced by doAllOrphans(), and doAllPages().

RecompressTracked::startSlaveProcs (  ) 

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 169 of file recompressTracked.php.

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

Referenced by executeParent().

RecompressTracked::syncDBs (  ) 

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 113 of file recompressTracked.php.

References $dbr, $dbw, and wfGetDB().

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


Member Data Documentation

RecompressTracked::$batchSize = 1000

Definition at line 25 of file recompressTracked.php.

RecompressTracked::$cmdLineOptionMap [static]

Initial value:

 array(
                'procs' => 'numProcs',
                'copy-only' => 'copyOnly',
                'child' => 'isChild',
                'slave-id' => 'slaveId',
                'debug-log' => 'debugLog',
                'info-log' => 'infoLog',
                'critical-log' => 'criticalLog',
        )

Definition at line 38 of file recompressTracked.php.

RecompressTracked::$copyOnly = false

Definition at line 31 of file recompressTracked.php.

RecompressTracked::$criticalLog

Definition at line 34 of file recompressTracked.php.

RecompressTracked::$debugLog

Definition at line 34 of file recompressTracked.php.

RecompressTracked::$destClusters

Definition at line 24 of file recompressTracked.php.

RecompressTracked::$infoLog

Definition at line 34 of file recompressTracked.php.

RecompressTracked::$isChild = false

Definition at line 32 of file recompressTracked.php.

RecompressTracked::$numProcs = 1

Definition at line 28 of file recompressTracked.php.

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

Definition at line 37 of file recompressTracked.php.

RecompressTracked::$orphanBatchSize = 1000

Definition at line 26 of file recompressTracked.php.

RecompressTracked::$orphanBlobClass

Definition at line 29 of file recompressTracked.php.

RecompressTracked::$pageBlobClass

Definition at line 29 of file recompressTracked.php.

RecompressTracked::$prevSlaveId

Definition at line 30 of file recompressTracked.php.

RecompressTracked::$reportingInterval = 10

Definition at line 27 of file recompressTracked.php.

RecompressTracked::$slaveId = false

Definition at line 33 of file recompressTracked.php.

Referenced by dispatch(), and dispatchToSlave().

RecompressTracked::$slavePipes

Definition at line 30 of file recompressTracked.php.

RecompressTracked::$slaveProcs

Definition at line 30 of file recompressTracked.php.

RecompressTracked::$store

Definition at line 35 of file recompressTracked.php.

RecompressTracked::$useDiff

Definition at line 29 of file recompressTracked.php.


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

Generated on Sat Sep 5 02:08:45 2009 for MediaWiki by  doxygen 1.5.9