Sn1per has uploaded a new change for review.
https://gerrit.wikimedia.org/r/259405
Change subject: Replace EchoBatchRowUpdate with BatchRowUpdate
......................................................................
Replace EchoBatchRowUpdate with BatchRowUpdate
Bug: T119253
Change-Id: I4c0d7187c2b847297dd0867faecba26185cfba37
---
M includes/Data/Utils/UserMerger.php
M includes/Import/Postprocessor/LqtNotifications.php
M includes/Utils/NamespaceIterator.php
M includes/Utils/PagesWithPropertyIterator.php
M maintenance/FlowAddMissingModerationLogs.php
M maintenance/FlowExternalStoreMoveCluster.php
M maintenance/FlowFixLog.php
M maintenance/FlowFixWorkflowLastUpdateTimestamp.php
M maintenance/FlowUpdateRevisionContentLength.php
M maintenance/FlowUpdateWorkflowPageId.php
M maintenance/repair_missing_revision_content.php
M maintenance/repair_missing_revision_content_from_parent.php
12 files changed, 25 insertions(+), 33 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/05/259405/1
diff --git a/includes/Data/Utils/UserMerger.php
b/includes/Data/Utils/UserMerger.php
index b8f4c07..11f4ac7 100644
--- a/includes/Data/Utils/UserMerger.php
+++ b/includes/Data/Utils/UserMerger.php
@@ -2,7 +2,6 @@
namespace Flow\Data\Utils;
-use EchoBatchRowIterator;
use Flow\Data\ManagerGroup;
use Flow\DbFactory;
use Flow\Model\AbstractRevision;
@@ -85,7 +84,7 @@
$dbw = $this->dbFactory->getDb( DB_MASTER );
foreach ( $this->config as $table => $config ) {
foreach ( $config['userColumns'] as $column =>
$userTupleGetter ) {
- $it = new EchoBatchRowIterator( $dbw, $table,
$config['pk'], 500 );
+ $it = new BatchRowIterator( $dbw, $table,
$config['pk'], 500 );
// The database is migrated, so look for the
new user id
$it->addConditions( array( $column =>
$newUserId ) );
if ( isset( $config['loadColumns'] ) ) {
diff --git a/includes/Import/Postprocessor/LqtNotifications.php
b/includes/Import/Postprocessor/LqtNotifications.php
index 05c1014..7e5bcb0 100644
--- a/includes/Import/Postprocessor/LqtNotifications.php
+++ b/includes/Import/Postprocessor/LqtNotifications.php
@@ -3,7 +3,6 @@
namespace Flow\Import\Postprocessor;
use DatabaseBase;
-use EchoBatchRowIterator;
use EchoCallbackIterator;
use EchoEvent;
use Flow\Import\IImportHeader;
@@ -97,7 +96,7 @@
throw new ImportException( 'No active thread!' );
}
- $it = new EchoBatchRowIterator(
+ $it = new BatchRowIterator(
$this->dbw,
/* table = */ 'user_message_state',
/* primary keys */ array( 'ums_user' ),
diff --git a/includes/Utils/NamespaceIterator.php
b/includes/Utils/NamespaceIterator.php
index a52a356..7f8fd18 100644
--- a/includes/Utils/NamespaceIterator.php
+++ b/includes/Utils/NamespaceIterator.php
@@ -3,7 +3,6 @@
namespace Flow\Utils;
use DatabaseBase;
-use EchoBatchRowIterator;
use EchoCallbackIterator;
use Iterator;
use IteratorAggregate;
@@ -38,7 +37,7 @@
* @return Iterator<Title>
*/
public function getIterator() {
- $it = new EchoBatchRowIterator(
+ $it = new BatchRowIterator(
$this->db,
/* tables */ array( 'page' ),
/* pk */ 'page_id',
diff --git a/includes/Utils/PagesWithPropertyIterator.php
b/includes/Utils/PagesWithPropertyIterator.php
index c6cc33b..d0b1965 100644
--- a/includes/Utils/PagesWithPropertyIterator.php
+++ b/includes/Utils/PagesWithPropertyIterator.php
@@ -3,7 +3,6 @@
namespace Flow\Utils;
use DatabaseBase;
-use EchoBatchRowIterator;
use EchoCallbackIterator;
use IteratorAggregate;
use RecursiveIteratorIterator;
@@ -54,7 +53,7 @@
* @return Iterator<Title>
*/
public function getIterator() {
- $it = new EchoBatchRowIterator(
+ $it = new BatchRowIterator(
$this->db,
/* tables */ array( 'page_props', 'page' ),
/* pk */ 'pp_page',
diff --git a/maintenance/FlowAddMissingModerationLogs.php
b/maintenance/FlowAddMissingModerationLogs.php
index 9236d17..25977dd 100644
--- a/maintenance/FlowAddMissingModerationLogs.php
+++ b/maintenance/FlowAddMissingModerationLogs.php
@@ -39,7 +39,7 @@
$moderationLoggingListener =
$container['storage.post.listeners.moderation_logging'];
- $rowIterator = new EchoBatchRowIterator(
+ $rowIterator = new BatchRowIterator(
$dbw,
/* table = */'flow_revision',
/* primary key = */'rev_id',
diff --git a/maintenance/FlowExternalStoreMoveCluster.php
b/maintenance/FlowExternalStoreMoveCluster.php
index 67be68e..6ef7f6f 100644
--- a/maintenance/FlowExternalStoreMoveCluster.php
+++ b/maintenance/FlowExternalStoreMoveCluster.php
@@ -5,7 +5,6 @@
require_once ( getenv( 'MW_INSTALL_PATH' ) !== false
? getenv( 'MW_INSTALL_PATH' ) . '/maintenance/Maintenance.php'
: dirname( __FILE__ ) . '/../../../maintenance/Maintenance.php' );
-require_once( __DIR__ . '/../../Echo/includes/BatchRowUpdate.php' );
/**
* @ingroup Maintenance
@@ -63,7 +62,7 @@
/** @var DatabaseBase $dbw */
$dbw = $schema['dbw'];
- $iterator = new EchoBatchRowIterator( $dbr, $schema['table'],
$schema['pk'], $this->mBatchSize );
+ $iterator = new BatchRowIterator( $dbr, $schema['table'],
$schema['pk'], $this->mBatchSize );
$iterator->setFetchColumns( array( $schema['content'],
$schema['flags'] ) );
$clusterConditions = array();
@@ -75,9 +74,9 @@
$dbr->makeList( $clusterConditions, LIST_OR ),
) );
- $updater = new EchoBatchRowUpdate(
+ $updater = new BatchRowUpdate(
$iterator,
- new EchoBatchRowWriter( $dbw, $schema['table'] ),
+ new BatchRowWriter( $dbw, $schema['table'] ),
new ExternalStoreUpdateGenerator( $this, $to, $schema )
);
$updater->setOutput( array( $this, 'output' ) );
@@ -108,7 +107,7 @@
}
}
-class ExternalStoreUpdateGenerator implements EchoRowUpdateGenerator {
+class ExternalStoreUpdateGenerator implements RowUpdateGenerator {
/**
* @var ExternalStoreMoveCluster
*/
diff --git a/maintenance/FlowFixLog.php b/maintenance/FlowFixLog.php
index 34097bb..37e4d53 100644
--- a/maintenance/FlowFixLog.php
+++ b/maintenance/FlowFixLog.php
@@ -10,7 +10,6 @@
require_once ( getenv( 'MW_INSTALL_PATH' ) !== false
? getenv( 'MW_INSTALL_PATH' ) . '/maintenance/Maintenance.php'
: dirname( __FILE__ ) . '/../../../maintenance/Maintenance.php' );
-require_once( __DIR__ . '/../../Echo/includes/BatchRowUpdate.php' );
/**
* Fixes Flow log entries.
@@ -31,7 +30,7 @@
}
protected function doDBUpdates() {
- $iterator = new EchoBatchRowIterator( wfGetDB( DB_SLAVE ),
'logging', 'log_id', $this->mBatchSize );
+ $iterator = new BatchRowIterator( wfGetDB( DB_SLAVE ),
'logging', 'log_id', $this->mBatchSize );
$iterator->setFetchColumns( array( 'log_id', 'log_params' ) );
$iterator->addConditions( array(
'log_type' => array( 'delete', 'suppress' ),
@@ -41,9 +40,9 @@
),
) );
- $updater = new EchoBatchRowUpdate(
+ $updater = new BatchRowUpdate(
$iterator,
- new EchoBatchRowWriter( wfGetDB( DB_MASTER ), 'logging'
),
+ new BatchRowWriter( wfGetDB( DB_MASTER ), 'logging' ),
new LogRowUpdateGenerator( $this )
);
$updater->setOutput( array( $this, 'output' ) );
@@ -76,7 +75,7 @@
}
}
-class LogRowUpdateGenerator implements EchoRowUpdateGenerator {
+class LogRowUpdateGenerator implements RowUpdateGenerator {
/**
* @var FlowFixLog
*/
diff --git a/maintenance/FlowFixWorkflowLastUpdateTimestamp.php
b/maintenance/FlowFixWorkflowLastUpdateTimestamp.php
index 638fa1e..7171a5d 100644
--- a/maintenance/FlowFixWorkflowLastUpdateTimestamp.php
+++ b/maintenance/FlowFixWorkflowLastUpdateTimestamp.php
@@ -12,7 +12,6 @@
require_once ( getenv( 'MW_INSTALL_PATH' ) !== false
? getenv( 'MW_INSTALL_PATH' ) . '/maintenance/Maintenance.php'
: dirname( __FILE__ ) . '/../../../maintenance/Maintenance.php' );
-require_once( __DIR__ . '/../../Echo/includes/BatchRowUpdate.php' );
/**
* @ingroup Maintenance
@@ -33,11 +32,11 @@
$storage = Container::get( 'storage' );
$rootPostLoader = Container::get( 'loader.root_post' );
- $iterator = new EchoBatchRowIterator( $dbFactory->getDB(
DB_SLAVE ), 'flow_workflow', 'workflow_id', $this->mBatchSize );
+ $iterator = new BatchRowIterator( $dbFactory->getDB( DB_SLAVE
), 'flow_workflow', 'workflow_id', $this->mBatchSize );
$iterator->setFetchColumns( array( 'workflow_id',
'workflow_type', 'workflow_last_update_timestamp' ) );
$iterator->addConditions( array( 'workflow_wiki' => wfWikiId()
) );
- $updater = new EchoBatchRowUpdate(
+ $updater = new BatchRowUpdate(
$iterator,
new UpdateWorkflowLastUpdateTimestampWriter( $storage,
$wgFlowCluster ),
new UpdateWorkflowLastUpdateTimestampGenerator(
$storage, $rootPostLoader )
@@ -59,7 +58,7 @@
}
}
-class UpdateWorkflowLastUpdateTimestampGenerator implements
EchoRowUpdateGenerator {
+class UpdateWorkflowLastUpdateTimestampGenerator implements RowUpdateGenerator
{
/**
* @var ManagerGroup
*/
@@ -148,7 +147,7 @@
}
}
-class UpdateWorkflowLastUpdateTimestampWriter extends EchoBatchRowWriter {
+class UpdateWorkflowLastUpdateTimestampWriter extends BatchRowWriter {
/**
* @var ManagerGroup
*/
diff --git a/maintenance/FlowUpdateRevisionContentLength.php
b/maintenance/FlowUpdateRevisionContentLength.php
index a4c8bdf..f89f641 100644
--- a/maintenance/FlowUpdateRevisionContentLength.php
+++ b/maintenance/FlowUpdateRevisionContentLength.php
@@ -74,7 +74,7 @@
$dbw = $this->dbFactory->getDb( DB_MASTER );
// Walk through the flow_revision table
- $it = new EchoBatchRowIterator(
+ $it = new BatchRowIterator(
$dbw,
/* table = */'flow_revision',
/* primary key = */'rev_id',
diff --git a/maintenance/FlowUpdateWorkflowPageId.php
b/maintenance/FlowUpdateWorkflowPageId.php
index 7ff32a1..7146f5b 100644
--- a/maintenance/FlowUpdateWorkflowPageId.php
+++ b/maintenance/FlowUpdateWorkflowPageId.php
@@ -9,7 +9,6 @@
$IP = dirname( __FILE__ ) . '/../../..';
}
require_once( "$IP/maintenance/Maintenance.php" );
-require_once __DIR__ . "/../../Echo/includes/BatchRowUpdate.php";
/**
* In some cases we have created workflow instances before the related Title
@@ -33,7 +32,7 @@
$dbw = Container::get( 'db.factory' )->getDB( DB_MASTER );
- $it = new EchoBatchRowIterator(
+ $it = new BatchRowIterator(
$dbw,
'flow_workflow',
'workflow_id',
@@ -45,8 +44,8 @@
) );
$gen = new WorkflowPageIdUpdateGenerator( $wgLang );
- $writer = new EchoBatchRowWriter( $dbw, 'flow_workflow',
$wgFlowCluster );
- $updater = new EchoBatchRowUpdate( $it, $writer, $gen );
+ $writer = new BatchRowWriter( $dbw, 'flow_workflow',
$wgFlowCluster );
+ $updater = new BatchRowUpdate( $it, $writer, $gen );
$updater->execute();
@@ -64,7 +63,7 @@
* Looks at rows from the flow_workflow table and returns an update
* for the workflow_page_id field if necessary.
*/
-class WorkflowPageIdUpdateGenerator implements EchoRowUpdateGenerator {
+class WorkflowPageIdUpdateGenerator implements RowUpdateGenerator {
/**
* @var Language|StubUserLang
*/
@@ -96,7 +95,7 @@
if ( $row->workflow_page_id === 0 && $title->getArticleID() ===
0 ) {
// build workflow object (yes, loading them piecemeal
is suboptimal, but
// this is just a one-time script; considering the
alternative is
- // creating a derivative EchoBatchRowIterator that
returns workflows,
+ // creating a derivative BatchRowIterator that returns
workflows,
// it doesn't really matter)
$storage = Container::get( 'storage' );
$workflow = $storage->get( 'Workflow', UUID::create(
$row->workflow_id ) );
diff --git a/maintenance/repair_missing_revision_content.php
b/maintenance/repair_missing_revision_content.php
index 0ece306..79cee32 100644
--- a/maintenance/repair_missing_revision_content.php
+++ b/maintenance/repair_missing_revision_content.php
@@ -26,7 +26,7 @@
}
fputcsv( $csvOutput, array( "uuid", "esurl", "flags" ) );
-$it = new EchoBatchRowIterator(
+$it = new BatchRowIterator(
Flow\Container::get( 'db.factory' )->getDB( DB_SLAVE ),
'flow_revision',
array( 'rev_id' ),
diff --git a/maintenance/repair_missing_revision_content_from_parent.php
b/maintenance/repair_missing_revision_content_from_parent.php
index e053734..eb81762 100644
--- a/maintenance/repair_missing_revision_content_from_parent.php
+++ b/maintenance/repair_missing_revision_content_from_parent.php
@@ -22,7 +22,7 @@
fputcsv( $csvOutput, array( "uuid", "esurl", "flags" ) );
$dbr = Flow\Container::get( 'db.factory' )->getDB( DB_SLAVE );
-$it = new EchoBatchRowIterator(
+$it = new BatchRowIterator(
$dbr,
'flow_revision',
array( 'rev_id' ),
--
To view, visit https://gerrit.wikimedia.org/r/259405
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4c0d7187c2b847297dd0867faecba26185cfba37
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Sn1per <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits