SolrReindexQueuedJobBase
abstract class SolrReindexQueuedJobBase implements QueuedJob (View source)
Base class for jobs which perform re-index
Properties
protected | bool | $isComplete | Flag whether this job is done |
|
protected | array | $messages | List of messages |
|
protected | LoggerInterface | $logger | Logger to use for this job |
Methods
Sets data about the job
Setup this queued job. This is only called the first time this job is executed (ie when currentStep is 0)
What type of job is this? Options are
- QueuedJob::IMMEDIATE
- QueuedJob::QUEUED
- QueuedJob::LARGE
Details
__construct()
No description
protected SearchLogFactory
getLoggerFactory()
No description
protected LoggerInterface
getLogger()
Gets a logger for this job
setLogger(LoggerInterface $logger)
Assign custom logger for this job
getJobData()
Return the current job state as an object containing data
stdClass ( 'totalSteps' => the total number of steps in this job - this is relayed to the user as an indicator of time 'currentStep' => the current number of steps done so far. 'isComplete' => whether the job is finished yet 'jobData' => data that the job wants persisted when it is stopped or started 'messages' => a cumulative array of messages that have occurred during this job so far )
setJobData(int $totalSteps, int $currentStep, bool $isComplete, stdClass $jobData, array $messages)
Sets data about the job
is an inverse of the getJobData() method, but being explicit about what data is set
protected SolrReindexHandler
getHandler()
Get the reindex handler
jobFinished()
Returns true or false to indicate that this job is finished
prepareForRestart()
Called whenever a job is restarted for whatever reason.
This is a separate method so that broken jobs can do some fixup before restarting.
setup()
Setup this queued job. This is only called the first time this job is executed (ie when currentStep is 0)
afterComplete()
No description
getJobType()
What type of job is this? Options are
- QueuedJob::IMMEDIATE
- QueuedJob::QUEUED
- QueuedJob::LARGE
addMessage(string $message)
Add an arbitrary text message into a job