Package com.atlassian.jira.index.ha
Class DefaultNodeReindexService
java.lang.Object
com.atlassian.jira.index.ha.DefaultNodeReindexService
- All Implemented Interfaces:
NodeReindexService
- Direct Known Subclasses:
ZDUAwareNodeReindexService
Runs periodically and re-indexes/de-indexes issues that have been indexed in the cluster (since 8.10 replays local operations as well).
The reason for replaying local index operations are:
- replay uncommitted node operation from the same node (because of PERIODIC commits)
- provide eventual consistency of deletes (update with lower version wins the conditional update with deletes)
- fix any other broken indexing transactions (which did not make it to the local index but made it to the index operation DB table)
- Since:
- v6.1
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultNodeReindexService(ClusterManager clusterManager, NodeIndexCounterStore nodeIndexCounterStore, OfBizReplicatedIndexOperationStore ofBizNodeIndexOperationStore, IssueIndexManager indexManager, SharedEntityIndexer sharedEntityIndexer, ProjectManager projectManager, ProjectReindexService projectReindexService, IssueManager issueManager, CommentManager commentManager, WorklogManager worklogManager, SharedEntityResolver sharedEntityResolver, IndexCopyService indexCopyService, IssueIndexingService indexingService, InternalIndexingService internalIndexingService, IndexLifecycleManager indexLifecycleManager, FailedReplicationOperationService failedReplicationOperationService, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the index on the invoking node can be rebuilt from the information contained in the ReplicatedIndexOperationStore.booleanReturns true is any other node has completed full reindex or project reindex and this node has not consumed this replicated operation yet (i.e.booleanisPaused()voidpause()Pause the service.voidReset the index count to the last entry in the NodeIndexOperation table for each node.voidshutDown()shuts down this service - this must be the last operation performed on this service;voidstart()
-
Field Details
-
PREFIX
- See Also:
-
PERIOD_SEC
public static final int PERIOD_SEC- See Also:
-
-
Constructor Details
-
Method Details
-
shutDown
public void shutDown()Description copied from interface:NodeReindexServiceshuts down this service - this must be the last operation performed on this service;- Specified by:
shutDownin interfaceNodeReindexService
-
start
public void start()- Specified by:
startin interfaceNodeReindexService
-
pause
public void pause()Description copied from interface:NodeReindexServicePause the service. This will wait for any current execution of the service polling to finish. Can be restarted withNodeReindexService.start()- Specified by:
pausein interfaceNodeReindexService
-
isPaused
public boolean isPaused()- Specified by:
isPausedin interfaceNodeReindexService
-
resetIndexCount
public void resetIndexCount()Description copied from interface:NodeReindexServiceReset the index count to the last entry in the NodeIndexOperation table for each node. This is done to mark the current state before getting a new index copy or performing a full reindex. In effect changes performed on other nodes but not yet replicated to this node will be skipped and not replicated to this node.It would normally be done immediately following a pause() of the service.
- Specified by:
resetIndexCountin interfaceNodeReindexService
-
canIndexBeRebuilt
public boolean canIndexBeRebuilt()Description copied from interface:NodeReindexServiceReturns true if the index on the invoking node can be rebuilt from the information contained in the ReplicatedIndexOperationStore. If the ReplicatedIndexOperationStore is empty then it is assumed the index can be rebuilt.- Specified by:
canIndexBeRebuiltin interfaceNodeReindexService- Returns:
- true if the index can be rebuilt
-
hasPendingReindexOperations
public boolean hasPendingReindexOperations()Description copied from interface:NodeReindexServiceReturns true is any other node has completed full reindex or project reindex and this node has not consumed this replicated operation yet (i.e. has not loaded the new index snapshot).- Specified by:
hasPendingReindexOperationsin interfaceNodeReindexService- Returns:
- true if there's a pending reindex operation to be consumed
-
totalStats
- Specified by:
totalStatsin interfaceNodeReindexService
-