/**
* Sends dump output via the p7zip compressor.
*
- * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
+ * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
* https://www.mediawiki.org/
*
* This program is free software; you can redistribute it and/or modify
/**
* Sends dump output via the bgzip2 compressor.
*
- * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
+ * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
* https://www.mediawiki.org/
*
* This program is free software; you can redistribute it and/or modify
/**
* Stream outputter to send data to a file.
*
- * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
+ * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
* https://www.mediawiki.org/
*
* This program is free software; you can redistribute it and/or modify
* This just does output filtering and streaming; XML formatting is done
* higher up, so be careful in what you do.
*
- * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
+ * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
* https://www.mediawiki.org/
*
* This program is free software; you can redistribute it and/or modify
/**
* Sends dump output via the gzip compressor.
*
- * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
+ * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
* https://www.mediawiki.org/
*
* This program is free software; you can redistribute it and/or modify
/**
* Dump output filter to include only the last revision in each page sequence.
*
- * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
+ * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
* https://www.mediawiki.org/
*
* This program is free software; you can redistribute it and/or modify
/**
* Base class for output stream; prints to stdout or buffer or wherever.
*
- * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
+ * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
* https://www.mediawiki.org/
*
* This program is free software; you can redistribute it and/or modify
/**
* Dump output filter to include or exclude pages in a given set of namespaces.
*
- * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
+ * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
* https://www.mediawiki.org/
*
* This program is free software; you can redistribute it and/or modify
/**
* Simple dump output filter to exclude all talk pages.
*
- * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
+ * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
* https://www.mediawiki.org/
*
* This program is free software; you can redistribute it and/or modify
/**
* Base class for output stream; prints to stdout or buffer or wherever.
*
- * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
+ * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
* https://www.mediawiki.org/
*
* This program is free software; you can redistribute it and/or modify
* Even if compression is available in a library, using a separate
* program can allow us to make use of a multi-processor system.
*
- * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
+ * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
* https://www.mediawiki.org/
*
* This program is free software; you can redistribute it and/or modify
/**
* Base class for exporting
*
- * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
+ * Copyright © 2003, 2005, 2006 Brion Vibber <brion@pobox.com>
* https://www.mediawiki.org/
*
* This program is free software; you can redistribute it and/or modify
* - containerPaths : Map of container names to custom file system directories.
* This should only be used for backwards-compatibility.
* - fileMode : Octal UNIX file permissions to use on files stored.
+ * @param array $config
*/
public function __construct( array $config ) {
parent::__construct( $config );
}
}
- /**
- * @see FileBackendStore::doClearCache()
- */
protected function doClearCache( array $paths = null ) {
clearstatcache(); // clear the PHP file stat cache
}
}
/**
- * @param FileBackendStoreOpHandle[] $fileOpHandles
+ * @param FSFileOpHandle[] $fileOpHandles
*
* @return Status[]
*/
* - a) unexpected operation errors occurred (network partitions, disk full...)
* - b) significant operation errors occurred and 'force' was not set
*
- * @param array $performOps List of FileOp operations
+ * @param FileOp[] $performOps List of FileOp operations
* @param array $opts Batch operation options
* @param FileJournal $journal Journal to log operations to
* @return Status
protected static function runParallelBatches( array $pPerformOps, Status $status ) {
$aborted = false; // set to true on unexpected errors
foreach ( $pPerformOps as $performOpsBatch ) {
+ /** @var FileOp[] $performOpsBatch */
if ( $aborted ) { // check batch op abort flag...
// We can't continue (even with $ignoreErrors) as $predicates is wrong.
// Log the remaining ops as failed for recovery...
}
continue;
}
+ /** @var Status[] $statuses */
$statuses = array();
$opHandles = array();
// Get the backend; all sub-batch ops belong to a single backend
public $orphanBatchSize = 1000;
public $reportingInterval = 10;
public $numProcs = 1;
+ public $numBatches = 0;
public $useDiff, $pageBlobClass, $orphanBlobClass;
public $slavePipes, $slaveProcs, $prevSlaveId;
public $copyOnly = false;
return false;
}
- $row = $dbr->selectRow( 'blob_tracking', '*', false, __METHOD__ );
+ $row = $dbr->selectRow( 'blob_tracking', '*', '', __METHOD__ );
if ( !$row ) {
$this->info( "Warning: blob_tracking table contains no rows, skipping this wiki." );
$this->slavePipes = $this->slaveProcs = array();
for ( $i = 0; $i < $this->numProcs; $i++ ) {
- $pipes = false;
+ $pipes = array();
$spec = array(
array( 'pipe', 'r' ),
array( 'file', 'php://stdout', 'w' ),
break;
}
foreach ( $res as $row ) {
+ $startId = $row->bt_page;
$this->dispatch( 'doPage', $row->bt_page );
$i++;
}
- $startId = $row->bt_page;
$this->report( 'pages', $i, $numPages );
}
$this->report( 'pages', $i, $numPages );
}
$ids = array();
foreach ( $res as $row ) {
+ $startId = $row->bt_text_id;
$ids[] = $row->bt_text_id;
$i++;
}
call_user_func_array( array( $this, 'dispatch' ), $args );
}
- $startId = $row->bt_text_id;
$this->report( 'orphans', $i, $numOrphans );
}
$this->report( 'orphans', $i, $numOrphans );
$lastTextId = 0;
foreach ( $res as $row ) {
+ $startId = $row->bt_text_id;
if ( $lastTextId == $row->bt_text_id ) {
// Duplicate (null edit)
continue;
wfWaitForSlaves();
}
}
- $startId = $row->bt_text_id;
}
$this->debug( "$titleText: committing blob with " . $trx->getSize() . " items" );
exit( 1 );
}
$dbw = wfGetDB( DB_MASTER );
- $this->beginTransaction( $dbw, __METHOD__ );
+ $dbw->begin( __METHOD__ );
$dbw->update( 'text',
array( // set
'old_text' => $url,
array( 'bt_text_id' => $textId ),
__METHOD__
);
- $this->commitTransaction( $dbw, __METHOD__ );
+ $dbw->commit( __METHOD__ );
}
/**
}
$this->debug( 'Incomplete: ' . $res->numRows() . ' rows' );
foreach ( $res as $row ) {
+ $startId = $row->bt_text_id;
$this->moveTextRow( $row->bt_text_id, $row->bt_new_url );
if ( $row->bt_text_id % 10 == 0 ) {
wfWaitForSlaves();
}
}
- $startId = $row->bt_text_id;
}
}
* Class to represent a recompression operation for a single CGZ blob
*/
class CgzCopyTransaction {
+ /** @var RecompressTracked */
public $parent;
public $blobClass;
+ /** @var ConcatenatedGzipHistoryBlob */
public $cgz;
public $referrers;
* We do a locking read to prevent closer-run race conditions.
*/
$dbw = wfGetDB( DB_MASTER );
- $this->beginTransaction( $dbw, __METHOD__ );
+ $dbw->begin( __METHOD__ );
$res = $dbw->select( 'blob_tracking',
array( 'bt_text_id', 'bt_moved' ),
array( 'bt_text_id' => array_keys( $this->referrers ) ),
// All have been moved already
if ( $originalCount > 1 ) {
// This is suspcious, make noise
- $this->critical( "Warning: concurrent operation detected, are there two conflicting " .
+ $this->parent->critical(
+ "Warning: concurrent operation detected, are there two conflicting " .
"processes running, doing the same job?" );
}
$targetDB->commit( __METHOD__ );
// Critical section here: interruption at this point causes blob duplication
// Reversing the order of the commits would cause data loss instead
- $this->commitTransaction( $dbw, __METHOD__ );
+ $dbw->commit( __METHOD__ );
// Write the new URLs to the text table and set the moved flag
if ( !$this->parent->copyOnly ) {