jenkins-bot has submitted this change and it was merged.

Change subject: Very minor cleanups to CirrusSearch\Job namespace
......................................................................


Very minor cleanups to CirrusSearch\Job namespace

Bug: T132625
Change-Id: I773c3a54ac584c0664547aef712786418c3a3bc1
---
M includes/Job/ElasticaWrite.php
M includes/Job/Job.php
M includes/Job/LinksUpdate.php
M includes/Job/MassIndex.php
M includes/Job/OtherIndex.php
5 files changed, 21 insertions(+), 7 deletions(-)

Approvals:
  Smalyshev: Looks good to me, approved
  Cindy-the-browser-test-bot: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/Job/ElasticaWrite.php b/includes/Job/ElasticaWrite.php
index 17a3ad4..dd0f944 100644
--- a/includes/Job/ElasticaWrite.php
+++ b/includes/Job/ElasticaWrite.php
@@ -4,6 +4,7 @@
 
 use CirrusSearch\Connection;
 use CirrusSearch\DataSender;
+use CirrusSearch\SearchConfig;
 use JobQueueGroup;
 use MediaWiki\Logger\LoggerFactory;
 use MediaWiki\MediaWikiServices;
@@ -105,7 +106,12 @@
                return $connections;
        }
 
-       private function canWriteToCluster( $config, $cluster ) {
+       /**
+        * @param SearchConfig $config
+        * @param string $cluster
+        * @return bool True is cluster is writable
+        */
+       private function canWriteToCluster( SearchConfig $config, $cluster ) {
                if ( $config->getElement( 'CirrusSearchClusters', $cluster ) 
=== null ) {
                        // No definition for the cluster
                        return false;
diff --git a/includes/Job/Job.php b/includes/Job/Job.php
index da3d252..5dd524d 100644
--- a/includes/Job/Job.php
+++ b/includes/Job/Job.php
@@ -34,12 +34,13 @@
        protected $connection;
 
        /**
-        * @var boolean should we retry if this job failed
+        * @var bool should we retry if this job failed
         */
        private $allowRetries = true;
 
        /**
         * Job constructor.
+        *
         * @param Title $title
         * @param array $params
         */
@@ -104,6 +105,7 @@
         * after it has expired.  By default it only checks every five minutes 
or so.
         * Note yet again that if another delay has been set that is longer 
then this one
         * then the _longer_ delay stays.
+        *
         * @param int $delay seconds to delay this job if possible
         */
        public function setDelay( $delay ) {
diff --git a/includes/Job/LinksUpdate.php b/includes/Job/LinksUpdate.php
index d4ddaa1..4c80554 100644
--- a/includes/Job/LinksUpdate.php
+++ b/includes/Job/LinksUpdate.php
@@ -1,8 +1,9 @@
 <?php
 
 namespace CirrusSearch\Job;
-use \JobQueueGroup;
-use \Title;
+
+use JobQueueGroup;
+use Title;
 
 /**
  * Performs the appropriate updates to Elasticsearch after a LinksUpdate is
diff --git a/includes/Job/MassIndex.php b/includes/Job/MassIndex.php
index 80afe2d..be58354 100644
--- a/includes/Job/MassIndex.php
+++ b/includes/Job/MassIndex.php
@@ -62,6 +62,9 @@
                return $count >= 0;
        }
 
+       /**
+        * @return int
+        */
        public function workItemCount() {
                return count( $this->params[ 'pageDBKeys' ] );
        }
diff --git a/includes/Job/OtherIndex.php b/includes/Job/OtherIndex.php
index 8f36f22..f891312 100644
--- a/includes/Job/OtherIndex.php
+++ b/includes/Job/OtherIndex.php
@@ -1,9 +1,10 @@
 <?php
 
 namespace CirrusSearch\Job;
+
 use CirrusSearch\OtherIndexes;
-use \JobQueueGroup;
-use \Title;
+use JobQueueGroup;
+use Title;
 
 /**
  * Job wrapper around OtherIndexes. Used during page updates.
@@ -26,11 +27,12 @@
 class OtherIndex extends Job {
        /**
         * Check if we need to make a job and inject one if so.
+        *
         * @param Title[] $titles The title we might update
         * @param string|null $cluster The name of the cluster to write
         *  to, or null for all clusters.
         */
-       public static function queueIfRequired( $titles, $cluster ) {
+       public static function queueIfRequired( array $titles, $cluster ) {
                $titlesToUpdate = array();
                foreach( $titles as $title ) {
                        if ( OtherIndexes::getExternalIndexes( $title ) ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/283581
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I773c3a54ac584c0664547aef712786418c3a3bc1
Gerrit-PatchSet: 8
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <ebernhard...@wikimedia.org>
Gerrit-Reviewer: Cindy-the-browser-test-bot <bernhardsone...@gmail.com>
Gerrit-Reviewer: DCausse <dcau...@wikimedia.org>
Gerrit-Reviewer: Gehel <gleder...@wikimedia.org>
Gerrit-Reviewer: Manybubbles <never...@wikimedia.org>
Gerrit-Reviewer: Smalyshev <smalys...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to