Class DefaultReIndexJobManager
java.lang.Object
com.atlassian.confluence.internal.index.status.DefaultReIndexJobManager
- All Implemented Interfaces:
ReIndexJobManager,ReIndexJobManagerInternal
This implementation of
ReIndexJobManager listens to indexing-related events and update re-index status accordingly- Since:
- 7.6.0
-
Field Summary
Fields inherited from interface com.atlassian.confluence.internal.index.status.ReIndexJobManagerInternal
JOB_PERSISTER_LOCK_NAME, REINDEX_IMPROVEMENT_DARKFEATURE_KEY -
Method Summary
Modifier and TypeMethodDescriptionbooleanMark most recent or running re-index job as acknowledged.voidclear()Delete most recent or running re-index job.createNewJob(List<String> spaceKeys) Create a new job which may replace a completed job stored in the bandana table.booleanReturns true if an in progress reindex job exists in the clustervoidonIndexRebuildFinished(ReindexFinishedEvent reindexFinishedEvent) voidonIndexRebuildSkipped(ReindexSkippedEvent reindexSkippedEvent) voidonIndexRebuildStarted(ReindexStartedEvent startedEvent) voidvoidvoidonIndexSnapshotRestorationSkippedEvent(IndexSnapshotRestorationSkippedEvent indexSnapshotRestorationSkippedEvent) voidonIndexSnapshotRestoredSuccessfullyEvent(IndexSnapshotRestoredSuccessfullyEvent indexSnapshotRestoredSuccessfullyEvent) voidonReIndexFailedEvent(ReIndexFailedEvent reIndexFailedEvent) voidonReIndexRequest(ReIndexRequestEvent reIndexRequestEvent) voidvoidregister()voidvoidupdateReIndexJob(ReIndexJob reIndexJob) Update the reindexJob in an atomic operation (i.e.voidupdateReIndexJobIfPresent(Consumer<ReIndexJob> updater) Try to update running re-index job in an atomic operation, synchronised by a cluster-wide lock.
-
Method Details
-
register
@PostConstruct public void register() -
unregister
@PreDestroy public void unregister() -
getRunningOrMostRecentReIndex
- Specified by:
getRunningOrMostRecentReIndexin interfaceReIndexJobManager- Returns:
- most recent or running re-index job. Empty if there is neither.
-
acknowledgeRunningJob
Description copied from interface:ReIndexJobManagerMark most recent or running re-index job as acknowledged. No-op if there is neither.- Specified by:
acknowledgeRunningJobin interfaceReIndexJobManager- Returns:
- true if most recent/running re-index job has been successfully marked as acknowledged.
- Throws:
InterruptedException- if interrupted when trying to ack the job
-
updateReIndexJobIfPresent
public void updateReIndexJobIfPresent(Consumer<ReIndexJob> updater) throws InterruptedException, TimeoutException Try to update running re-index job in an atomic operation, synchronised by a cluster-wide lock.- Specified by:
updateReIndexJobIfPresentin interfaceReIndexJobManagerInternal- Parameters:
updater- a callback to mutate runningReIndexJob- Throws:
InterruptedException- if interrupted while waiting to update the jobTimeoutException- if cannot obtain exclusive access in order to update the job within reasonable time
-
updateReIndexJob
Description copied from interface:ReIndexJobManagerInternalUpdate the reindexJob in an atomic operation (i.e. with a cluster lock)- Specified by:
updateReIndexJobin interfaceReIndexJobManagerInternal- Throws:
InterruptedExceptionTimeoutException
-
isReIndexing
public boolean isReIndexing()Description copied from interface:ReIndexJobManagerReturns true if an in progress reindex job exists in the cluster- Specified by:
isReIndexingin interfaceReIndexJobManager
-
createNewJob
Description copied from interface:ReIndexJobManagerCreate a new job which may replace a completed job stored in the bandana table.- Specified by:
createNewJobin interfaceReIndexJobManager- Returns:
- the new job if it can be created
-
clear
public void clear()Description copied from interface:ReIndexJobManagerDelete most recent or running re-index job. No-op if there is neither- Specified by:
clearin interfaceReIndexJobManager
-
onReIndexRequest
-
onIndexRebuildStarted
-
onIndexRebuildFinished
@EventListener public void onIndexRebuildFinished(ReindexFinishedEvent reindexFinishedEvent) throws InterruptedException - Throws:
InterruptedException
-
onIndexRebuildSkipped
@EventListener public void onIndexRebuildSkipped(ReindexSkippedEvent reindexSkippedEvent) throws InterruptedException - Throws:
InterruptedException
-
onRestoreIndexSnapshotStartedEvent
@EventListener public void onRestoreIndexSnapshotStartedEvent(RestoreIndexSnapshotStartedEvent ignored) throws InterruptedException - Throws:
InterruptedException
-
onIndexSnapshotCreationFailedEvent
@EventListener public void onIndexSnapshotCreationFailedEvent(IndexSnapshotCreationFailedEvent failedEvent) throws InterruptedException - Throws:
InterruptedException
-
onIndexSnapshotRestoredSuccessfullyEvent
@EventListener public void onIndexSnapshotRestoredSuccessfullyEvent(IndexSnapshotRestoredSuccessfullyEvent indexSnapshotRestoredSuccessfullyEvent) throws InterruptedException - Throws:
InterruptedException
-
onIndexSnapshotRestorationFailedEvent
@EventListener public void onIndexSnapshotRestorationFailedEvent(IndexSnapshotRestorationFailedEvent failedEvent) throws InterruptedException - Throws:
InterruptedException
-
onIndexSnapshotRestorationSkippedEvent
@EventListener public void onIndexSnapshotRestorationSkippedEvent(IndexSnapshotRestorationSkippedEvent indexSnapshotRestorationSkippedEvent) throws InterruptedException - Throws:
InterruptedException
-
onReIndexFailedEvent
@EventListener public void onReIndexFailedEvent(ReIndexFailedEvent reIndexFailedEvent) throws InterruptedException - Throws:
InterruptedException
-