Class IndexQueueService

java.lang.Object
sk.iway.iwcm.rag.service.IndexQueueService

@Service public class IndexQueueService extends Object
Service for managing the RAG indexing queue. Provides methods to add, remove, and query entries in the rag_index_queue table. Entries are processed asynchronously by RagIndexCronTask.
  • Constructor Details

  • Method Details

    • addToQueue

      public void addToQueue(List<Integer> entityIds, RagEntityType entityType, RagIndexAction action, int domainId)
      Add multiple entities to the indexing queue. Removes any existing queue entries for these entities first. For DELETE actions, only entities that actually have stored chunks are queued.
      Parameters:
      entityIds - list of entity IDs to queue
      entityType - the entity type (e.g. DOCUMENT)
      action - the action to perform (INDEX or DELETE)
      domainId - the domain ID
      Throws:
      IllegalArgumentException - if any parameter is invalid
    • addToQueue

      public void addToQueue(int entityId, RagEntityType entityType, RagIndexAction action, int domainId)
      Add a single entity to the indexing queue. Removes any existing queue entry for this entity first.
      Parameters:
      entityId - the entity ID to queue
      entityType - the entity type (e.g. DOCUMENT)
      action - the action to perform (INDEX or DELETE)
      domainId - the domain ID
      Throws:
      IllegalArgumentException - if any parameter is invalid
    • getQueued

      public List<Integer> getQueued(RagEntityType entityType, RagIndexAction action, Integer domainId)
      Get the list of entity IDs currently queued for the given entity type, action and domain.
      Parameters:
      entityType - the entity type to filter by
      action - the action to filter by
      domainId - the domain ID to filter by
      Returns:
      list of queued entity IDs
      Throws:
      IllegalArgumentException - if any parameter is invalid