[MediaWiki-commits] [Gerrit] Rename UpdatePagesJob - MassIndexJob - change (mediawiki...CirrusSearch)

2014-01-21 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Rename UpdatePagesJob - MassIndexJob
..


Rename UpdatePagesJob - MassIndexJob

The name is misleading for what it actually does. Now we've
got clear separation between script-induced jobs and things
that come from normal wiki operations.

Change-Id: I1454329e73cb114aafbf724ece13d14f1e95d81d
---
M CirrusSearch.php
R includes/MassIndexJob.php
M maintenance/forceSearchIndex.php
3 files changed, 11 insertions(+), 7 deletions(-)

Approvals:
  Manybubbles: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/CirrusSearch.php b/CirrusSearch.php
index fcb37ce..1c65246 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -214,6 +214,7 @@
 $wgAutoloadClasses['CirrusSearch\FullTextResultsType'] = $includes . 
'ResultsType.php';
 $wgAutoloadClasses['CirrusSearch\Job'] = $includes . 'Job.php';
 $wgAutoloadClasses['CirrusSearch\MappingConfigBuilder'] = $includes . 
'MappingConfigBuilder.php';
+$wgAutoloadClasses['CirrusSearch\MassIndexJob'] = $includes . 
'MassIndexJob.php';
 $wgAutoloadClasses['CirrusSearch\NearMatchPicker'] = $includes . 
'NearMatchPicker.php';
 $wgAutoloadClasses['CirrusSearch\OtherIndexes'] = $includes . 
'OtherIndexes.php';
 $wgAutoloadClasses['CirrusSearch\OtherIndexJob'] = $includes . 
'OtherIndexJob.php';
@@ -224,7 +225,6 @@
 $wgAutoloadClasses['CirrusSearch\Searcher'] = $includes . 'Searcher.php';
 $wgAutoloadClasses['CirrusSearch\TextFormatter'] = $includes . 
'TextFormatter.php';
 $wgAutoloadClasses['CirrusSearch\TitleResultsType'] = $includes . 
'ResultsType.php';
-$wgAutoloadClasses['CirrusSearch\UpdatePagesJob'] = $includes . 
'UpdatePagesJob.php';
 $wgAutoloadClasses['CirrusSearch\UpdateSearchIndexConfig'] = __DIR__ . 
'/maintenance/updateSearchIndexConfig.php';
 $wgAutoloadClasses['CirrusSearch\Updater'] = $includes . 'Updater.php';
 
@@ -253,5 +253,7 @@
 $wgJobClasses[ 'cirrusSearchLinksUpdate' ] = 'CirrusSearch\LinksUpdateJob';
 $wgJobClasses[ 'cirrusSearchLinksUpdatePrioritized' ] = 
'CirrusSearch\LinksUpdateJob';
 $wgJobClasses[ 'cirrusSearchLinksUpdateSecondary' ] = 
'CirrusSearch\LinksUpdateSecondaryJob';
+$wgJobClasses[ 'cirrusSearchMassIndex' ] = 'CirrusSearch\MassIndexJob';
 $wgJobClasses[ 'cirrusSearchOtherIndex' ] = 'CirrusSearch\OtherIndexJob';
-$wgJobClasses[ 'cirrusSearchUpdatePages' ] = 'CirrusSearch\UpdatePagesJob';
+// todo: remove once no more UpdatePages jobs are left in any queues
+$wgJobClasses[ 'cirrusSearchUpdatePages' ] = 'CirrusSearch\MassIndexJob';
diff --git a/includes/UpdatePagesJob.php b/includes/MassIndexJob.php
similarity index 94%
rename from includes/UpdatePagesJob.php
rename to includes/MassIndexJob.php
index 46dd144..8addb67 100644
--- a/includes/UpdatePagesJob.php
+++ b/includes/MassIndexJob.php
@@ -23,7 +23,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  */
-class UpdatePagesJob extends Job {
+class MassIndexJob extends Job {
public static function build( $pages, $checkFreshness, $updateFlags ) {
// Strip $pages down to PrefixedDBKeys so we don't put a ton of 
stuff in the job queue.
$pageDBKeys = array();
@@ -32,7 +32,7 @@
}
 
// We don't have a title for this job so we use the Main Page 
because it exists.
-   return new UpdatePagesJob( Title::newMainPage(), array(
+   return new MassIndexJob( Title::newMainPage(), array(
'pageDBKeys' = $pageDBKeys,
'checkFreshness' = $checkFreshness,
'updateFlags' = $updateFlags,
diff --git a/maintenance/forceSearchIndex.php b/maintenance/forceSearchIndex.php
index 6d84b2f..5d4bb79 100644
--- a/maintenance/forceSearchIndex.php
+++ b/maintenance/forceSearchIndex.php
@@ -195,7 +195,7 @@
}
}
JobQueueGroup::singleton()-push(
-   UpdatePagesJob::build( $pages, 
!$this-forceUpdate, $updateFlags ) );
+   MassIndexJob::build( $pages, 
!$this-forceUpdate, $updateFlags ) );
} else {
// Update size with the actual number 
of updated documents.
$updater = new Updater();
@@ -433,11 +433,13 @@
}
 
/**
-* Get the number of cirrusSearchUpdatePages jobs in the queue.
+* Get the number of cirrusSearchMassIndex jobs in the queue.
 * @return int length
 */
private function getUpdatesInQueue() {
-   return JobQueueGroup::singleton()-get( 
'cirrusSearchUpdatePages' )-getSize();
+   return JobQueueGroup::singleton()-get( 'cirrusSearchMassIndex' 

[MediaWiki-commits] [Gerrit] Rename UpdatePagesJob - MassIndexJob - change (mediawiki...CirrusSearch)

2014-01-16 Thread Chad (Code Review)
Chad has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/107987


Change subject: Rename UpdatePagesJob - MassIndexJob
..

Rename UpdatePagesJob - MassIndexJob

The name is misleading for what it actually does. Now we've
got clear separation between script-induced jobs and things
that come from normal wiki operations.

Change-Id: I1454329e73cb114aafbf724ece13d14f1e95d81d
---
M CirrusSearch.php
R includes/MassIndexJob.php
M maintenance/forceSearchIndex.php
3 files changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/87/107987/1

diff --git a/CirrusSearch.php b/CirrusSearch.php
index fcb37ce..372417a 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -214,6 +214,7 @@
 $wgAutoloadClasses['CirrusSearch\FullTextResultsType'] = $includes . 
'ResultsType.php';
 $wgAutoloadClasses['CirrusSearch\Job'] = $includes . 'Job.php';
 $wgAutoloadClasses['CirrusSearch\MappingConfigBuilder'] = $includes . 
'MappingConfigBuilder.php';
+$wgAutoloadClasses['CirrusSearch\MassIndexJob'] = $includes . 
'MassIndexJob.php';
 $wgAutoloadClasses['CirrusSearch\NearMatchPicker'] = $includes . 
'NearMatchPicker.php';
 $wgAutoloadClasses['CirrusSearch\OtherIndexes'] = $includes . 
'OtherIndexes.php';
 $wgAutoloadClasses['CirrusSearch\OtherIndexJob'] = $includes . 
'OtherIndexJob.php';
@@ -224,7 +225,6 @@
 $wgAutoloadClasses['CirrusSearch\Searcher'] = $includes . 'Searcher.php';
 $wgAutoloadClasses['CirrusSearch\TextFormatter'] = $includes . 
'TextFormatter.php';
 $wgAutoloadClasses['CirrusSearch\TitleResultsType'] = $includes . 
'ResultsType.php';
-$wgAutoloadClasses['CirrusSearch\UpdatePagesJob'] = $includes . 
'UpdatePagesJob.php';
 $wgAutoloadClasses['CirrusSearch\UpdateSearchIndexConfig'] = __DIR__ . 
'/maintenance/updateSearchIndexConfig.php';
 $wgAutoloadClasses['CirrusSearch\Updater'] = $includes . 'Updater.php';
 
@@ -253,5 +253,5 @@
 $wgJobClasses[ 'cirrusSearchLinksUpdate' ] = 'CirrusSearch\LinksUpdateJob';
 $wgJobClasses[ 'cirrusSearchLinksUpdatePrioritized' ] = 
'CirrusSearch\LinksUpdateJob';
 $wgJobClasses[ 'cirrusSearchLinksUpdateSecondary' ] = 
'CirrusSearch\LinksUpdateSecondaryJob';
+$wgJobClasses[ 'cirrusSearchMassIndexJob' ] = 'CirrusSearch\MassIndexJob';
 $wgJobClasses[ 'cirrusSearchOtherIndex' ] = 'CirrusSearch\OtherIndexJob';
-$wgJobClasses[ 'cirrusSearchUpdatePages' ] = 'CirrusSearch\UpdatePagesJob';
diff --git a/includes/UpdatePagesJob.php b/includes/MassIndexJob.php
similarity index 94%
rename from includes/UpdatePagesJob.php
rename to includes/MassIndexJob.php
index 46dd144..8addb67 100644
--- a/includes/UpdatePagesJob.php
+++ b/includes/MassIndexJob.php
@@ -23,7 +23,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  */
-class UpdatePagesJob extends Job {
+class MassIndexJob extends Job {
public static function build( $pages, $checkFreshness, $updateFlags ) {
// Strip $pages down to PrefixedDBKeys so we don't put a ton of 
stuff in the job queue.
$pageDBKeys = array();
@@ -32,7 +32,7 @@
}
 
// We don't have a title for this job so we use the Main Page 
because it exists.
-   return new UpdatePagesJob( Title::newMainPage(), array(
+   return new MassIndexJob( Title::newMainPage(), array(
'pageDBKeys' = $pageDBKeys,
'checkFreshness' = $checkFreshness,
'updateFlags' = $updateFlags,
diff --git a/maintenance/forceSearchIndex.php b/maintenance/forceSearchIndex.php
index 6d84b2f..15b90d4 100644
--- a/maintenance/forceSearchIndex.php
+++ b/maintenance/forceSearchIndex.php
@@ -195,7 +195,7 @@
}
}
JobQueueGroup::singleton()-push(
-   UpdatePagesJob::build( $pages, 
!$this-forceUpdate, $updateFlags ) );
+   MassIndexJob::build( $pages, 
!$this-forceUpdate, $updateFlags ) );
} else {
// Update size with the actual number 
of updated documents.
$updater = new Updater();
@@ -433,11 +433,11 @@
}
 
/**
-* Get the number of cirrusSearchUpdatePages jobs in the queue.
+* Get the number of cirrusSearchMassIndex jobs in the queue.
 * @return int length
 */
private function getUpdatesInQueue() {
-   return JobQueueGroup::singleton()-get( 
'cirrusSearchUpdatePages' )-getSize();
+   return JobQueueGroup::singleton()-get( 'cirrusSearchMassIndex' 
)-getSize();
}
 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/107987
To