public class DefaultReIndexJobManager extends Object implements ReIndexJobManagerInternal
ReIndexJobManager listens to indexing-related events and update re-index status accordinglyREINDEX_IMPROVEMENT_DARKFEATURE_KEY| Constructor and Description |
|---|
DefaultReIndexJobManager(ReIndexJobPersister persister,
com.atlassian.event.api.EventPublisher eventPublisher,
com.atlassian.scheduler.SchedulerService schedulerService,
ClusterManager clusterManager,
com.atlassian.beehive.ClusterLockService clusterLockService,
com.atlassian.sal.api.features.DarkFeatureManager darkFeatureManager,
BootstrapManager bootstrapManager) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acknowledgeRunningJob()
Mark most recent or running re-index job as acknowledged.
|
void |
clear()
Delete most recent or running re-index job.
|
Optional<ReIndexJob> |
getRunningOrMostRecentReIndex() |
void |
onIndexRebuildFinished(ReindexFinishedEvent ignored) |
void |
onIndexRebuildStarted(ReindexStartedEvent startedEvent) |
void |
onIndexSnapshotCreationFailedEvent(IndexSnapshotCreationFailedEvent failedEvent) |
void |
onIndexSnapshotRestorationFailedEvent(IndexSnapshotRestorationFailedEvent failedEvent) |
void |
onIndexSnapshotRestoredSuccessfullyEvent(IndexSnapshotRestoredSuccessfullyEvent ignored) |
void |
onRestoreIndexSnapshotStartedEvent(RestoreIndexSnapshotStartedEvent ignored) |
void |
register() |
void |
unregister() |
void |
updateReIndexJobIfPresent(Consumer<ReIndexJob> updater)
Try to update running re-index job in an atomic operation, synchronised by a cluster-wide lock.
|
public DefaultReIndexJobManager(ReIndexJobPersister persister, com.atlassian.event.api.EventPublisher eventPublisher, com.atlassian.scheduler.SchedulerService schedulerService, ClusterManager clusterManager, com.atlassian.beehive.ClusterLockService clusterLockService, com.atlassian.sal.api.features.DarkFeatureManager darkFeatureManager, BootstrapManager bootstrapManager)
@PostConstruct public void register()
@PreDestroy public void unregister()
public Optional<ReIndexJob> getRunningOrMostRecentReIndex()
getRunningOrMostRecentReIndex in interface ReIndexJobManagerpublic boolean acknowledgeRunningJob()
throws InterruptedException
ReIndexJobManageracknowledgeRunningJob in interface ReIndexJobManagerInterruptedException - if interrupted when trying to ack the jobpublic void updateReIndexJobIfPresent(Consumer<ReIndexJob> updater) throws InterruptedException, TimeoutException
updateReIndexJobIfPresent in interface ReIndexJobManagerInternalupdater - a callback to mutate running ReIndexJobInterruptedException - if interrupted while waiting to update the jobTimeoutException - if cannot obtain exclusive access in order to update the job within reasonable timepublic void clear()
ReIndexJobManagerInternalclear in interface ReIndexJobManagerInternal@EventListener public void onIndexRebuildStarted(ReindexStartedEvent startedEvent)
@EventListener public void onIndexRebuildFinished(ReindexFinishedEvent ignored) throws InterruptedException
InterruptedException@EventListener public void onRestoreIndexSnapshotStartedEvent(RestoreIndexSnapshotStartedEvent ignored) throws InterruptedException
InterruptedException@EventListener public void onIndexSnapshotCreationFailedEvent(IndexSnapshotCreationFailedEvent failedEvent) throws InterruptedException
InterruptedException@EventListener public void onIndexSnapshotRestoredSuccessfullyEvent(IndexSnapshotRestoredSuccessfullyEvent ignored) throws InterruptedException
InterruptedException@EventListener public void onIndexSnapshotRestorationFailedEvent(IndexSnapshotRestorationFailedEvent failedEvent) throws InterruptedException
InterruptedExceptionCopyright © 2003–2022 Atlassian. All rights reserved.