Class ClusterSynchronisedReplicatedIndexOperationsServiceImpl
java.lang.Object
com.atlassian.jira.search.index.rio.ClusterSynchronisedReplicatedIndexOperationsServiceImpl
- All Implemented Interfaces:
ReplicatedIndexOperationsService
public class ClusterSynchronisedReplicatedIndexOperationsServiceImpl
extends Object
implements ReplicatedIndexOperationsService
A service that contains logic for working with Index Operations from the
OfBizReplicatedIndexOperationStore.-
Constructor Summary
ConstructorsConstructorDescriptionClusterSynchronisedReplicatedIndexOperationsServiceImpl(OfBizReplicatedIndexOperationStore ofBizReplicatedIndexOperationStore, ReplicatedIndexOperationConsistencyChecker replicatedIndexOperationConsistencyChecker, IssuesIndexRequestFactory issuesIndexRequestFactory, IndexingFeatures indexingFeatures) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyOperationsToIndex(List<EntityWithOperation> operationsToApply, IndexWriter indexWriter) compact(Collection<ReplicatedIndexOperation> indexOps) Compacts the given index operations for the specified entity type.Filters the relevant operations from the given collection of replicated index operations.getAllUnprocessedReplicatedIndexOperations(String nodeId, long afterId) Returns all unprocessed replicated index operations.getUnappliedOperations(Collection<EntityWithOperation> indexOps, IndexAccessor indexAccessor) Filters out from given operations all operations representing entities which are already searchable in local index with version greater or equal to the operation version
-
Constructor Details
-
ClusterSynchronisedReplicatedIndexOperationsServiceImpl
public ClusterSynchronisedReplicatedIndexOperationsServiceImpl(OfBizReplicatedIndexOperationStore ofBizReplicatedIndexOperationStore, ReplicatedIndexOperationConsistencyChecker replicatedIndexOperationConsistencyChecker, IssuesIndexRequestFactory issuesIndexRequestFactory, IndexingFeatures indexingFeatures)
-
-
Method Details
-
getAllUnprocessedReplicatedIndexOperations
public Set<ReplicatedIndexOperation> getAllUnprocessedReplicatedIndexOperations(String nodeId, long afterId) Description copied from interface:ReplicatedIndexOperationsServiceReturns all unprocessed replicated index operations.- Specified by:
getAllUnprocessedReplicatedIndexOperationsin interfaceReplicatedIndexOperationsService- Parameters:
nodeId- the node ID to retrieve the replicated operations forafterId- the operation ID to retrieve operations after- Returns:
- a set of unprocessed replicated index operations
-
filterRelevantOperations
public List<ReplicatedIndexOperation> filterRelevantOperations(Collection<ReplicatedIndexOperation> indexOps) Description copied from interface:ReplicatedIndexOperationsServiceFilters the relevant operations from the given collection of replicated index operations.- Specified by:
filterRelevantOperationsin interfaceReplicatedIndexOperationsService- Parameters:
indexOps- the collection of replicated index operations to filter- Returns:
- a list of relevant replicated index operations
-
compact
Compacts the given index operations for the specified entity type.- Specified by:
compactin interfaceReplicatedIndexOperationsService- Parameters:
indexOps- the collection of replicated index operations to compact- Returns:
- a list of
EntityWithOperationcontaining the operation with the latest version for each entity ID
-
getUnappliedOperations
public List<EntityWithOperation> getUnappliedOperations(Collection<EntityWithOperation> indexOps, IndexAccessor indexAccessor) throws SearchException Description copied from interface:ReplicatedIndexOperationsServiceFilters out from given operations all operations representing entities which are already searchable in local index with version greater or equal to the operation version- Specified by:
getUnappliedOperationsin interfaceReplicatedIndexOperationsService- Parameters:
indexOps- the replicated index operations to filter- Returns:
- a list of replicated index operations that have not been indexed yet
- Throws:
SearchException
-
applyOperationsToIndex
public void applyOperationsToIndex(List<EntityWithOperation> operationsToApply, IndexWriter indexWriter) throws IndexOperationException - Specified by:
applyOperationsToIndexin interfaceReplicatedIndexOperationsService- Throws:
IndexOperationException
-