indexName = $indexName; $this->state = $state; $this->class = $class; $this->groups = $groups; $this->group = $group; } public function getJobData() { $data = parent::getJobData(); // Custom data $data->jobData->indexName = $this->indexName; $data->jobData->state = $this->state; $data->jobData->class = $this->class; $data->jobData->groups = $this->groups; $data->jobData->group = $this->group; return $data; } public function setJobData($totalSteps, $currentStep, $isComplete, $jobData, $messages) { parent::setJobData($totalSteps, $currentStep, $isComplete, $jobData, $messages); // Custom data $this->indexName = $jobData->indexName; $this->state = $jobData->state; $this->class = $jobData->class; $this->groups = $jobData->groups; $this->group = $jobData->group; } public function getSignature() { return md5(get_class($this) . time() . mt_rand(0, 100000)); } public function getTitle() { return sprintf( 'Solr Reindex Group (%d/%d) of %s in %s', ($this->group+1), $this->groups, $this->class, json_encode($this->state) ); } public function process() { $logger = $this->getLogger(); if($this->jobFinished()) { $logger->notice("reindex group already complete"); return; } // Get instance of index $indexInstance = singleton($this->indexName); // Send back to processor $logger->info("Beginning reindex group"); $this ->getHandler() ->runGroup($logger, $indexInstance, $this->state, $this->class, $this->groups, $this->group); $logger->info("Completed reindex group"); $this->isComplete = true; } }