Package io.jmix.search.index.queue.impl
Class JpaIndexingQueueManager.QueueItemsAggregator
java.lang.Object
io.jmix.search.index.queue.impl.JpaIndexingQueueManager.QueueItemsAggregator
- Enclosing class:
- JpaIndexingQueueManager
Analyzes collection of
IndexingQueueItem
, determines unique entity ids
and splits them among two disjoint groups: for index and for delete.
Group for specific id is determined by 'effective queue item' - the latest one for that id.
In case of multiple queue items related to single entity id it allows to perform only one actual operation on each id and remove all related queue items.
-
Constructor Summary
ModifierConstructorDescriptionprotected
QueueItemsAggregator
(Collection<IndexingQueueItem> queueItems) -
Method Summary
Modifier and TypeMethodDescriptionprotected Map<Id<?>,
List<IndexingQueueItem>> Gets all entity ids that should be deleted from index.protected Map<Id<?>,
List<IndexingQueueItem>> Gets all entity ids that should be indexed.protected Map<Id<?>,
List<IndexingQueueItem>> getOperationItemsGroup
(IndexingOperation operation) protected void
groupQueueItems
(Collection<IndexingQueueItem> queueItems)
-
Constructor Details
-
QueueItemsAggregator
-
-
Method Details
-
getIndexItemsGroup
Gets all entity ids that should be indexed.Every entity id is mapped to all
IndexingQueueItem
related to this id.- Returns:
- Map with entity ids as keys and lists of related queue items as values
-
getDeleteItemsGroup
Gets all entity ids that should be deleted from index.Every entity id is mapped to all
IndexingQueueItem
related to this id.- Returns:
- Map with entity ids as keys and lists of related queue items as values
-
getOperationItemsGroup
-
groupQueueItems
-