Class JpaIndexingQueueManager.QueueItemsAggregator

java.lang.Object
io.jmix.search.index.queue.impl.JpaIndexingQueueManager.QueueItemsAggregator
Enclosing class:
JpaIndexingQueueManager

protected class JpaIndexingQueueManager.QueueItemsAggregator extends Object
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 Details

  • Method Details

    • getIndexItemsGroup

      protected Map<Id<?>,List<IndexingQueueItem>> 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

      protected Map<Id<?>,List<IndexingQueueItem>> 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

      protected Map<Id<?>,List<IndexingQueueItem>> getOperationItemsGroup(IndexingOperation operation)
    • groupQueueItems

      protected void groupQueueItems(Collection<IndexingQueueItem> queueItems)