Class RetryQueue
java.lang.Object
ai.attackframework.tools.burp.utils.opensearch.RetryQueue
Per-index bounded queues for failed OpenSearch index operations.
When a push fails, documents can be offered to the queue; a drain thread
later retries them. When the queue is full, new documents are rejected.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanallEmpty()Returns true if all known queues are empty.voidclearAll()Clears all queued retry documents across all indexes.booleanReturns true if the queue for the given index is empty or absent.booleanOffers a single document to the queue for the given index.intOffers multiple documents to the queue for the given index.Removes up to maxSize documents from the queue for the given index.intReturns the current number of documents queued for the given index.intReturns total number of queued documents across all indexes (for logging).
-
Constructor Details
-
RetryQueue
public RetryQueue(int maxSizePerIndex)
-
-
Method Details
-
offer
Offers a single document to the queue for the given index.- Parameters:
indexName- full index name (e.g. attackframework-tool-burp-traffic)document- document to retry later- Returns:
- true if accepted, false if queue full
-
offerAll
Offers multiple documents to the queue for the given index. Stops at first failure (queue full); earlier docs may have been added.- Parameters:
indexName- full index namedocuments- documents to retry later- Returns:
- number of documents actually accepted (0 to documents.size())
-
pollBatch
Removes up to maxSize documents from the queue for the given index.- Parameters:
indexName- full index namemaxSize- maximum number of documents to poll- Returns:
- list of documents (may be empty, never null)
-
size
Returns the current number of documents queued for the given index. -
isEmpty
Returns true if the queue for the given index is empty or absent. -
allEmpty
public boolean allEmpty()Returns true if all known queues are empty. -
totalSize
public int totalSize()Returns total number of queued documents across all indexes (for logging). -
clearAll
public void clearAll()Clears all queued retry documents across all indexes.
-