protected function doDBUpdates() {
$dbw = $this->getDB( DB_MASTER );
+ $batchSize = $this->getBatchSize();
if ( !$dbw->fieldExists( 'recentchanges', 'rc_source' ) ) {
$this->error( 'rc_source field in recentchanges table does not exist.' );
}
return true;
}
$end = $dbw->selectField( 'recentchanges', 'MAX(rc_id)', false, __METHOD__ );
- $end += $this->mBatchSize - 1;
+ $end += $batchSize - 1;
$blockStart = $start;
- $blockEnd = $start + $this->mBatchSize - 1;
+ $blockEnd = $start + $batchSize - 1;
$updatedValues = $this->buildUpdateCondition( $dbw );
$this->output( "." );
wfWaitForSlaves();
- $blockStart += $this->mBatchSize;
- $blockEnd += $this->mBatchSize;
+ $blockStart += $batchSize;
+ $blockEnd += $batchSize;
}
$this->output( "\nDone.\n" );
protected function doLenUpdates( $table, $idCol, $prefix, $queryInfo ) {
$dbr = $this->getDB( DB_REPLICA );
$dbw = $this->getDB( DB_MASTER );
+ $batchSize = $this->getBatchSize();
$start = $dbw->selectField( $table, "MIN($idCol)", false, __METHOD__ );
$end = $dbw->selectField( $table, "MAX($idCol)", false, __METHOD__ );
if ( !$start || !$end ) {
# Do remaining chunks
$blockStart = intval( $start );
- $blockEnd = intval( $start ) + $this->mBatchSize - 1;
+ $blockEnd = intval( $start ) + $batchSize - 1;
$count = 0;
while ( $blockStart <= $end ) {
$this->commitTransaction( $dbw, __METHOD__ );
}
- $blockStart += $this->mBatchSize;
- $blockEnd += $this->mBatchSize;
+ $blockStart += $batchSize;
+ $blockEnd += $batchSize;
wfWaitForSlaves();
}
*/
protected function doSha1Updates( $table, $idCol, $queryInfo, $prefix ) {
$db = $this->getDB( DB_MASTER );
+ $batchSize = $this->getBatchSize();
$start = $db->selectField( $table, "MIN($idCol)", false, __METHOD__ );
$end = $db->selectField( $table, "MAX($idCol)", false, __METHOD__ );
if ( !$start || !$end ) {
$count = 0;
# Do remaining chunk
- $end += $this->mBatchSize - 1;
+ $end += $batchSize - 1;
$blockStart = $start;
- $blockEnd = $start + $this->mBatchSize - 1;
+ $blockEnd = $start + $batchSize - 1;
while ( $blockEnd <= $end ) {
$this->output( "...doing $idCol from $blockStart to $blockEnd\n" );
$cond = "$idCol BETWEEN $blockStart AND $blockEnd
}
$this->commitTransaction( $db, __METHOD__ );
- $blockStart += $this->mBatchSize;
- $blockEnd += $this->mBatchSize;
+ $blockStart += $batchSize;
+ $blockEnd += $batchSize;
wfWaitForSlaves();
}
$this->output( "Building content page file cache from page {$start}!\n" );
$dbr = $this->getDB( DB_REPLICA );
+ $batchSize = $this->getBatchSize();
$overwrite = $this->hasOption( 'overwrite' );
$start = ( $start > 0 )
? $start
$_SERVER['HTTP_ACCEPT_ENCODING'] = 'bgzip'; // hack, no real client
# Do remaining chunk
- $end += $this->mBatchSize - 1;
+ $end += $batchSize - 1;
$blockStart = $start;
- $blockEnd = $start + $this->mBatchSize - 1;
+ $blockEnd = $start + $batchSize - 1;
$dbw = $this->getDB( DB_MASTER );
// Go through each page and save the output
}
$this->commitTransaction( $dbw, __METHOD__ ); // commit any changes (just for sanity)
- $blockStart += $this->mBatchSize;
- $blockEnd += $this->mBatchSize;
+ $blockStart += $batchSize;
+ $blockEnd += $batchSize;
}
$this->output( "Done!\n" );
}
'rc_timestamp < ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffTo ) )
]
);
- foreach ( array_chunk( $rcids, $this->mBatchSize ) as $rcidBatch ) {
+ foreach ( array_chunk( $rcids, $this->getBatchSize() ) as $rcidBatch ) {
$dbw->delete( 'recentchanges', [ 'rc_id' => $rcidBatch ], __METHOD__ );
wfGetLBFactory()->waitForReplication();
}
] + $rcCommentStore->insert( $dbw, $comment ),
__METHOD__
);
- if ( ( ++$inserted % $this->mBatchSize ) == 0 ) {
+ if ( ( ++$inserted % $this->getBatchSize() ) == 0 ) {
wfGetLBFactory()->waitForReplication();
}
}
$error = 0;
$dbw = $this->getDB( DB_MASTER );
- if ( $this->mBatchSize <= 0 ) {
+ $batchSize = $this->getBatchSize();
+ if ( $batchSize <= 0 ) {
$this->error( "Batch size is too low...", 12 );
}
}
$options = [
- 'LIMIT' => $this->mBatchSize,
+ 'LIMIT' => $batchSize,
'ORDER BY' => 'img_name ASC',
];
}
$conds2 = [ 'img_name > ' . $dbw->addQuotes( $row->img_name ) ];
wfWaitForSlaves();
- } while ( $res->numRows() === $this->mBatchSize );
+ } while ( $res->numRows() === $batchSize );
$total = $upgraded + $leftAlone;
if ( $force ) {
$redir = $this->hasOption( 'redirects-only' );
$oldRedir = $this->hasOption( 'old-redirects-only' );
$this->doRefreshLinks( $start, $new, $end, $redir, $oldRedir );
- $this->deleteLinksFromNonexistent( null, null, $this->mBatchSize, $dfnChunkSize );
+ $this->deleteLinksFromNonexistent( null, null, $this->getBatchSize(), $dfnChunkSize );
} else {
- $this->deleteLinksFromNonexistent( $start, $end, $this->mBatchSize, $dfnChunkSize );
+ $this->deleteLinksFromNonexistent( $start, $end, $this->getBatchSize(), $dfnChunkSize );
}
}
__METHOD__,
[
'ORDER BY' => [ 'cl_timestamp', 'cl_from' ],
- 'LIMIT' => $this->mBatchSize,
+ 'LIMIT' => $this->getBatchSize(),
]
);
self::fixLinksFromArticle( $row->page_id );
}
- } while ( $res->numRows() == $this->mBatchSize );
+ } while ( $res->numRows() == $this->getBatchSize() );
}
/**
public function execute() {
$db = $this->getDB( DB_MASTER );
+ $batchSize = $this->getBatchSize();
if ( !$db->tableExists( 'page_restrictions' ) ) {
$this->error( "page_restrictions table does not exist", true );
}
$end = $db->selectField( 'page', 'MAX(page_id)', false, __METHOD__ );
# Do remaining chunk
- $end += $this->mBatchSize - 1;
+ $end += $batchSize - 1;
$blockStart = $start;
- $blockEnd = $start + $this->mBatchSize - 1;
+ $blockEnd = $start + $batchSize - 1;
$encodedExpiry = 'infinity';
while ( $blockEnd <= $end ) {
$this->output( "...doing page_id from $blockStart to $blockEnd out of $end\n" );
throw new MWException( "Deadlock loop failed wtf :(" );
}
}
- $blockStart += $this->mBatchSize - 1;
- $blockEnd += $this->mBatchSize - 1;
+ $blockStart += $batchSize - 1;
+ $blockEnd += $batchSize - 1;
wfWaitForSlaves();
}
$this->output( "...removing dead rows from page_restrictions\n" );