Interface ReplicatedIndexOperationsService
- All Known Implementing Classes:
ClusterSynchronisedReplicatedIndexOperationsServiceImpl
public interface ReplicatedIndexOperationsService
Service that contains logic for working with Index Operations.
-
Method Summary
Modifier and TypeMethodDescriptionvoidapplyOperationsToIndex(List<EntityWithOperation> operationsToApply, IndexWriter indexWriter) compact(Collection<ReplicatedIndexOperation> indexOps) Compacts a list of replicated index operations by keeping only the latest operation for each entity.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
-
Method Details
-
getAllUnprocessedReplicatedIndexOperations
Set<ReplicatedIndexOperation> getAllUnprocessedReplicatedIndexOperations(String nodeId, long afterId) Returns all unprocessed replicated index operations.- 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
List<ReplicatedIndexOperation> filterRelevantOperations(Collection<ReplicatedIndexOperation> indexOps) Filters the relevant operations from the given collection of replicated index operations.- Parameters:
indexOps- the collection of replicated index operations to filter- Returns:
- a list of relevant replicated index operations
-
compact
Compacts a list of replicated index operations by keeping only the latest operation for each entity.- Returns:
- a list of processed replicated index operations
-
getUnappliedOperations
List<EntityWithOperation> getUnappliedOperations(Collection<EntityWithOperation> indexOps, IndexAccessor indexAccessor) throws SearchException 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- Parameters:
indexOps- the replicated index operations to filter- Returns:
- a list of replicated index operations that have not been indexed yet
- Throws:
SearchException
-
applyOperationsToIndex
void applyOperationsToIndex(List<EntityWithOperation> operationsToApply, IndexWriter indexWriter) throws IndexOperationException - Throws:
IndexOperationException
-