Interface IndexingQueueManager

All Known Implementing Classes:
JpaIndexingQueueManager

public interface IndexingQueueManager
Provides functionality for enqueuing entity instances and processing queue.
  • Method Details

    • emptyQueue

      int emptyQueue()
      Removes all queue items.
      Returns:
      amount of deleted items
    • emptyQueue

      int emptyQueue(String entityName)
      Removes all queue items related to provided entity.
      Parameters:
      entityName - entity
      Returns:
      amount of deleted items
    • enqueueIndex

      int enqueueIndex(Object entityInstance)
      Sends provided entity instance to indexing queue in order to store it to index.
      Parameters:
      entityInstance - instance
      Returns:
      amount of enqueued instances
    • enqueueIndexCollection

      int enqueueIndexCollection(Collection<Object> entityInstances)
      Sends provided entity instances to indexing queue in order to store them to index.
      Parameters:
      entityInstances - instances
      Returns:
      amount of enqueued instances
    • enqueueIndexByEntityId

      int enqueueIndexByEntityId(Id<?> entityId)
      Sends entity instance to indexing queue by provided ID in order to store it to index.
      Parameters:
      entityId - ID of entity instance
      Returns:
      amount of enqueued instances
    • enqueueIndexCollectionByEntityIds

      int enqueueIndexCollectionByEntityIds(Collection<Id<?>> entityIds)
      Sends entity instances to indexing queue by provided IDs in order to store them to index.
      Parameters:
      entityIds - IDs of entity instances
      Returns:
      amount of enqueued instances
    • enqueueIndexAll

      int enqueueIndexAll()
      Synchronously sends all instances of all index-configured entities to indexing queue.

      Don't use it on a huge amount of data - all ids (per entity) will be kept in memory during this process. Use initAsyncEnqueueIndexAll() methods instead.

      Returns:
      amount of enqueued instances
    • enqueueIndexAll

      int enqueueIndexAll(String entityName)
      Synchronously sends all instances of provided entity to indexing queue.

      Don't use it on a huge amount of data - all ids will be kept in memory during this process. Use initAsyncEnqueueIndexAll() methods instead.

      Parameters:
      entityName - entity name
      Returns:
      amount of enqueued instances
    • getEntityNamesOfEnqueueingSessions

      List<String> getEntityNamesOfEnqueueingSessions()
      Gets entity names of all existing enqueueing sessions.
      Returns:
      list of entity names
    • initAsyncEnqueueIndexAll

      void initAsyncEnqueueIndexAll()
      Initializes async enqueueing session for all indexed entities.
    • initAsyncEnqueueIndexAll

      boolean initAsyncEnqueueIndexAll(String entityName)
      Initializes async enqueueing session for provided entity. Existing session will be removed and created again.
      Parameters:
      entityName - entity name
      Returns:
      true if operation was successfully performed, false otherwise
    • suspendAsyncEnqueueIndexAll

      void suspendAsyncEnqueueIndexAll()
      Suspends all enqueueing sessions. Suspended sessions are ignored during session processing. Session can be resumed by resumeAsyncEnqueueIndexAll()
    • suspendAsyncEnqueueIndexAll

      boolean suspendAsyncEnqueueIndexAll(String entityName)
      Suspends enqueueing session for provided entity. Suspended sessions are ignored during session processing. Session can be resumed by resumeAsyncEnqueueIndexAll()
      Parameters:
      entityName - entity name
      Returns:
      true if operation was successfully performed, false otherwise
    • resumeAsyncEnqueueIndexAll

      void resumeAsyncEnqueueIndexAll()
      Resumes all previously suspended enqueueing sessions.
    • resumeAsyncEnqueueIndexAll

      boolean resumeAsyncEnqueueIndexAll(String entityName)
      Resumes previously suspended enqueueing session for provided entity.
      Parameters:
      entityName - entity name
      Returns:
      true if operation was successfully performed, false otherwise
    • terminateAsyncEnqueueIndexAll

      void terminateAsyncEnqueueIndexAll()
      Terminates all enqueueing sessions.
    • terminateAsyncEnqueueIndexAll

      boolean terminateAsyncEnqueueIndexAll(String entityName)
      Terminates enqueueing session for provided entity.
      Parameters:
      entityName - entity name
      Returns:
      true if operation was successfully performed, false otherwise
    • processNextEnqueueingSession

      int processNextEnqueueingSession()
      Processes next available enqueueing session - one batch (with default size) of entity instances will be enqueued.
      Returns:
      amount of processed entity instances
    • processNextEnqueueingSession

      int processNextEnqueueingSession(int batchSize)
      Processes next available enqueueing session - one batch (with provided size) of entity instances will be enqueued.
      Parameters:
      batchSize - batch size
      Returns:
      amount of processed entity instances
    • processEnqueueingSession

      int processEnqueueingSession(String entityName)
      Processes enqueueing session for provided entity - one batch (with default size) of entity instances will be enqueued.
      Parameters:
      entityName - entity name
      Returns:
      amount of processed entity instances
    • processEnqueueingSession

      int processEnqueueingSession(String entityName, int batchSize)
      Processes enqueueing session for provided entity - one batch (with provided size) of entity instances will be enqueued.
      Parameters:
      entityName - entity name
      batchSize - batch size
      Returns:
      amount of processed entity instances
    • enqueueDelete

      int enqueueDelete(Object entityInstance)
      Sends provided entity instance to indexing queue in order to delete it from index.
      Parameters:
      entityInstance - instance
      Returns:
      amount of enqueued instances
    • enqueueDeleteCollection

      int enqueueDeleteCollection(Collection<Object> entityInstances)
      Sends provided entity instances to indexing queue in order to delete them from index.
      Parameters:
      entityInstances - instances
      Returns:
      amount of enqueued instances
    • enqueueDeleteByEntityId

      int enqueueDeleteByEntityId(Id<?> entityId)
      Sends entity instance to indexing queue by provided ID in order to delete it from index.
      Parameters:
      entityId - ID of entity instance
      Returns:
      amount of enqueued instances
    • enqueueDeleteCollectionByEntityIds

      int enqueueDeleteCollectionByEntityIds(Collection<Id<?>> entityIds)
      Sends entity instances to indexing queue by provided IDs in order to delete them from index.
      Parameters:
      entityIds - IDs of entity instances
      Returns:
      amount of enqueued instances
    • processNextBatch

      int processNextBatch()
      Retrieves next batch of items from indexing queue and processes them - store/remove related documents in index.
      Returns:
      amount of processed queue items
    • processNextBatch

      int processNextBatch(int batchSize)
      Retrieves next batch of items from indexing queue and processes them - store/remove related documents in index.
      Parameters:
      batchSize - amount of queue items to process
      Returns:
      amount of processed queue items
    • processEntireQueue

      int processEntireQueue()
      Retrieves items from indexing queue and processes them - store/remove related documents in index.
      Returns:
      amount of processed queue items
    • processEntireQueue

      int processEntireQueue(int batchSize)
      Retrieves items from indexing queue and processes them - store/remove related documents in index.
      Parameters:
      batchSize - amount of queue items to process within single batch
      Returns:
      amount of processed queue items