Package io.jmix.search.index.queue
Interface IndexingQueueManager
- All Known Implementing Classes:
JpaIndexingQueueManager
public interface IndexingQueueManager
Provides functionality for enqueuing entity instances and processing queue.
-
Method Summary
Modifier and TypeMethodDescriptionint
Removes all queue items.int
emptyQueue
(String entityName) Removes all queue items related to provided entity.int
enqueueDelete
(Object entityInstance) Sends provided entity instance to indexing queue in order to delete it from index.int
enqueueDeleteByEntityId
(Id<?> entityId) Sends entity instance to indexing queue by provided ID in order to delete it from index.int
enqueueDeleteCollection
(Collection<Object> entityInstances) Sends provided entity instances to indexing queue in order to delete them from index.int
enqueueDeleteCollectionByEntityIds
(Collection<Id<?>> entityIds) Sends entity instances to indexing queue by provided IDs in order to delete them from index.int
enqueueIndex
(Object entityInstance) Sends provided entity instance to indexing queue in order to store it to index.int
Synchronously sends all instances of all index-configured entities to indexing queue.int
enqueueIndexAll
(String entityName) Synchronously sends all instances of provided entity to indexing queue.int
enqueueIndexByEntityId
(Id<?> entityId) Sends entity instance to indexing queue by provided ID in order to store it to index.int
enqueueIndexCollection
(Collection<Object> entityInstances) Sends provided entity instances to indexing queue in order to store them to index.int
enqueueIndexCollectionByEntityIds
(Collection<Id<?>> entityIds) Sends entity instances to indexing queue by provided IDs in order to store them to index.Gets entity names of all existing enqueueing sessions.void
Initializes async enqueueing session for all indexed entities.boolean
initAsyncEnqueueIndexAll
(String entityName) Initializes async enqueueing session for provided entity.int
processEnqueueingSession
(String entityName) Processes enqueueing session for provided entity - one batch (with default size) of entity instances will be enqueued.int
processEnqueueingSession
(String entityName, int batchSize) Processes enqueueing session for provided entity - one batch (with provided size) of entity instances will be enqueued.int
Retrieves items from indexing queue and processes them - store/remove related documents in index.int
processEntireQueue
(int batchSize) Retrieves items from indexing queue and processes them - store/remove related documents in index.int
Retrieves next batch of items from indexing queue and processes them - store/remove related documents in index.int
processNextBatch
(int batchSize) Retrieves next batch of items from indexing queue and processes them - store/remove related documents in index.int
Processes next available enqueueing session - one batch (with default size) of entity instances will be enqueued.int
processNextEnqueueingSession
(int batchSize) Processes next available enqueueing session - one batch (with provided size) of entity instances will be enqueued.void
Resumes all previously suspended enqueueing sessions.boolean
resumeAsyncEnqueueIndexAll
(String entityName) Resumes previously suspended enqueueing session for provided entity.void
Suspends all enqueueing sessions.boolean
suspendAsyncEnqueueIndexAll
(String entityName) Suspends enqueueing session for provided entity.void
Terminates all enqueueing sessions.boolean
terminateAsyncEnqueueIndexAll
(String entityName) Terminates enqueueing session for provided entity.
-
Method Details
-
emptyQueue
int emptyQueue()Removes all queue items.- Returns:
- amount of deleted items
-
emptyQueue
Removes all queue items related to provided entity.- Parameters:
entityName
- entity- Returns:
- amount of deleted items
-
enqueueIndex
Sends provided entity instance to indexing queue in order to store it to index.- Parameters:
entityInstance
- instance- Returns:
- amount of enqueued instances
-
enqueueIndexCollection
Sends provided entity instances to indexing queue in order to store them to index.- Parameters:
entityInstances
- instances- Returns:
- amount of enqueued instances
-
enqueueIndexByEntityId
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
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
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
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
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 byresumeAsyncEnqueueIndexAll()
-
suspendAsyncEnqueueIndexAll
Suspends enqueueing session for provided entity. Suspended sessions are ignored during session processing. Session can be resumed byresumeAsyncEnqueueIndexAll()
- Parameters:
entityName
- entity name- Returns:
- true if operation was successfully performed, false otherwise
-
resumeAsyncEnqueueIndexAll
void resumeAsyncEnqueueIndexAll()Resumes all previously suspended enqueueing sessions. -
resumeAsyncEnqueueIndexAll
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
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
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
Processes enqueueing session for provided entity - one batch (with provided size) of entity instances will be enqueued.- Parameters:
entityName
- entity namebatchSize
- batch size- Returns:
- amount of processed entity instances
-
enqueueDelete
Sends provided entity instance to indexing queue in order to delete it from index.- Parameters:
entityInstance
- instance- Returns:
- amount of enqueued instances
-
enqueueDeleteCollection
Sends provided entity instances to indexing queue in order to delete them from index.- Parameters:
entityInstances
- instances- Returns:
- amount of enqueued instances
-
enqueueDeleteByEntityId
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
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
-