public class DefaultReindexRequestManager extends Object implements ReindexRequestManager
| Constructor and Description |
|---|
DefaultReindexRequestManager(ReindexRequestDao reindexRequestDao,
com.atlassian.core.util.Clock clock,
ReindexRequestCoalescer requestCoalescer,
ClusterManager clusterManager,
com.atlassian.beehive.ClusterLockService clusterLockService,
TaskManager taskManager,
IndexLifecycleManager indexLifecycleManager,
I18nHelper.BeanFactory i18nFactory,
I18nHelper i18nHelper,
JohnsonProvider johnsonProvider) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearAll()
Clear any pending requests.
|
List<ReindexRequest> |
failRunningRequestsFromDeadNodes()
Finds any active or running requests from inactive nodes in the cluster and transitions them
to failed.
|
List<ReindexRequest> |
failRunningRequestsFromNode(String nodeId)
Finds any active or running requests from the specified node in the cluster and transitions them to failed.
|
Iterable<ReindexRequest> |
getPendingReindexRequests(Set<ReindexRequestType> reindexRequestTypes)
Retrieves all pending reindex requests, in order
from oldest to newest.
|
ReindexRequest |
getReindexProgress(Long requestId) |
Set<ReindexRequest> |
getReindexProgress(Set<Long> requestIds)
Retrieves the progress of some requests.
|
boolean |
isReindexInProgress() |
boolean |
isReindexRequested()
Checks if any ReindexRequests of any type are waiting to be processed.
|
boolean |
isReindexRequested(Set<ReindexRequestType> reindexRequestTypes)
Checks if any ReindexRequests are waiting to be processed.
|
protected ReindexRequest |
performReindex(ReindexRequest request,
boolean waitForCompletion,
boolean runInBackground) |
Set<ReindexRequest> |
processPendingRequests(boolean waitForCompletion,
Set<ReindexRequestType> reindexRequestTypes,
boolean runInBackground)
Process any outstanding reindex requests.
|
Iterable<ReindexRequest> |
readPendingReindexRequests(Set<ReindexRequestType> reindexRequestTypes,
boolean updateCoalescedRequests) |
ReindexRequest |
requestReindex(ReindexRequestType type,
Set<AffectedIndex> affectedIndexes,
Set<SharedEntityType> entityTypes)
Requests a reindex.
|
List<ReindexRequest> |
transitionStatus(Iterable<ReindexRequest> requests,
ReindexStatus newStatus)
Transitions the status of reindex requests.
|
ReindexRequest |
transitionStatus(ReindexRequest request,
ReindexStatus newStatus)
Transitions the status of a reindex request.
|
public DefaultReindexRequestManager(ReindexRequestDao reindexRequestDao, com.atlassian.core.util.Clock clock, ReindexRequestCoalescer requestCoalescer, ClusterManager clusterManager, com.atlassian.beehive.ClusterLockService clusterLockService, TaskManager taskManager, IndexLifecycleManager indexLifecycleManager, I18nHelper.BeanFactory i18nFactory, I18nHelper i18nHelper, JohnsonProvider johnsonProvider)
public boolean isReindexRequested()
ReindexRequestManagerisReindexRequested in interface ReindexRequestManagerpublic boolean isReindexRequested(Set<ReindexRequestType> reindexRequestTypes)
ReindexRequestManagerisReindexRequested in interface ReindexRequestManagerreindexRequestTypes - Types of requests to check for.@Nonnull public Iterable<ReindexRequest> getPendingReindexRequests(@Nonnull Set<ReindexRequestType> reindexRequestTypes)
ReindexRequestManagergetPendingReindexRequests in interface ReindexRequestManagerreindexRequestTypes - Types of requests to check for.@Nonnull public Iterable<ReindexRequest> readPendingReindexRequests(@Nonnull Set<ReindexRequestType> reindexRequestTypes, boolean updateCoalescedRequests)
public Set<ReindexRequest> processPendingRequests(boolean waitForCompletion, Set<ReindexRequestType> reindexRequestTypes, boolean runInBackground)
ReindexRequestManagerprocessPendingRequests in interface ReindexRequestManagerwaitForCompletion - If true this method will not return until the reindexing is complete, otherwise it will return
when the reindex task is submitted,reindexRequestTypes - Types of requests to process either ReindexRequestTyperunInBackground - If true the reindex should be a background reindex otherwise a foreground stop the world reindex@Nonnull protected ReindexRequest performReindex(@Nonnull ReindexRequest request, boolean waitForCompletion, boolean runInBackground) throws InterruptedException
InterruptedException@Nonnull public List<ReindexRequest> failRunningRequestsFromDeadNodes()
ReindexRequestManagerfailRunningRequestsFromDeadNodes in interface ReindexRequestManager@Nonnull public List<ReindexRequest> failRunningRequestsFromNode(@Nullable String nodeId)
ReindexRequestManagerfailRunningRequestsFromNode in interface ReindexRequestManagernodeId - the ID of the cluster node, or null if not clustered.public boolean isReindexInProgress()
isReindexInProgress in interface ReindexRequestManager@Nonnull public ReindexRequest requestReindex(@Nonnull ReindexRequestType type, @Nonnull Set<AffectedIndex> affectedIndexes, @Nonnull Set<SharedEntityType> entityTypes)
ReindexRequestManagerrequestReindex in interface ReindexRequestManagertype - whether reindex is immediate or delayed.affectedIndexes - the indexes to regenerate.entityTypes - the entity types whose indexes are to be regenerated.@Nonnull public List<ReindexRequest> transitionStatus(@Nonnull Iterable<ReindexRequest> requests, @Nonnull ReindexStatus newStatus)
ReindexRequestManagertransitionStatus in interface ReindexRequestManagerrequests - the requests.newStatus - the new status to transition to.@Nonnull public ReindexRequest transitionStatus(@Nonnull ReindexRequest request, @Nonnull ReindexStatus newStatus)
ReindexRequestManagertransitionStatus in interface ReindexRequestManagerrequest - the request.newStatus - the new status to transition to.@Nonnull public Set<ReindexRequest> getReindexProgress(@Nonnull Set<Long> requestIds)
ReindexRequestManagergetReindexProgress in interface ReindexRequestManagerrequestIds - the set of reindex request IDs to look up.public void clearAll()
ReindexRequestManagerclearAll in interface ReindexRequestManagerpublic ReindexRequest getReindexProgress(@Nonnull Long requestId)
Copyright © 2002-2024 Atlassian. All Rights Reserved.