if ( count( $args ) < 1 ) {
echo "Usage: php recompressTracked.php [options] <cluster> [... <cluster>...]
-Moves blobs indexed by trackBlobs.php to a specified list of destination clusters, and recompresses them in the process. Restartable.
+Moves blobs indexed by trackBlobs.php to a specified list of destination clusters,
+and recompresses them in the process. Restartable.
Options:
- --procs <procs> Set the number of child processes (default 1)
- --copy-only Copy only, do not update the text table. Restart without this option to complete.
- --debug-log <file> Log debugging data to the specified file
- --info-log <file> Log progress messages to the specified file
- --critical-log <file> Log error messages to the specified file
+ --procs <procs> Set the number of child processes (default 1)
+ --copy-only Copy only, do not update the text table. Restart
+ without this option to complete.
+ --debug-log <file> Log debugging data to the specified file
+ --info-log <file> Log progress messages to the specified file
+ --critical-log <file> Log error messages to the specified file
";
exit( 1 );
}
public $debugLog, $infoLog, $criticalLog;
public $store;
- static $optionsWithArgs = array( 'procs', 'slave-id', 'debug-log', 'info-log', 'critical-log' );
- static $cmdLineOptionMap = array(
+ private static $optionsWithArgs = array(
+ 'procs',
+ 'slave-id',
+ 'debug-log',
+ 'info-log',
+ 'critical-log'
+ );
+
+ private static $cmdLineOptionMap = array(
'no-count' => 'noCount',
'procs' => 'numProcs',
'copy-only' => 'copyOnly',
$jobOptions[$classOption] = $options[$cmdOption];
}
}
+
return new self( $jobOptions );
}
if ( $this->debugLog ) {
$this->logToFile( $msg, $this->debugLog );
}
-
}
function info( $msg ) {
$dbr = wfGetDB( DB_SLAVE );
if ( !$dbr->tableExists( 'blob_tracking' ) ) {
$this->critical( "Error: blob_tracking table does not exist" );
+
return false;
}
$row = $dbr->selectRow( 'blob_tracking', '*', false, __METHOD__ );
if ( !$row ) {
$this->info( "Warning: blob_tracking table contains no rows, skipping this wiki." );
+
return false;
}
+
return true;
}
if ( isset( $pipes[$slaveId] ) ) {
$this->prevSlaveId = $slaveId;
$this->dispatchToSlave( $slaveId, $args );
+
return;
}
}
$args = explode( ' ', $line );
$cmd = array_shift( $args );
switch ( $cmd ) {
- case 'doPage':
- $this->doPage( intval( $args[0] ) );
- break;
- case 'doOrphanList':
- $this->doOrphanList( array_map( 'intval', $args ) );
- break;
- case 'quit':
- return;
+ case 'doPage':
+ $this->doPage( intval( $args[0] ) );
+ break;
+ case 'doOrphanList':
+ $this->doOrphanList( array_map( 'intval', $args ) );
+ break;
+ case 'quit':
+ return;
}
$this->waitForSlaves();
}
if ( $cluster === false ) {
$cluster = reset( $this->destClusters );
}
+
return $cluster;
}
*/
function getExtDB( $cluster ) {
$lb = wfGetLBFactory()->getExternalLB( $cluster );
+
return $lb->getConnection( DB_MASTER );
}
$hash = $this->cgz->addItem( $text );
$this->referrers[$textId] = $hash;
$this->texts[$textId] = $text;
+
return $this->cgz->isHappy();
}
$this->critical( "Warning: concurrent operation detected, are there two conflicting " .
"processes running, doing the same job?" );
}
+
return;
}
$this->recompress();