Package org.apache.solr.servlet
Class RequestRateLimiter
java.lang.Object
org.apache.solr.servlet.RequestRateLimiter
- Direct Known Subclasses:
QueryRateLimiter
Handles rate limiting for a specific request type.
The control flow is as follows: Handle request -- Check if slot is available -- If available, acquire slot and proceed -- else reject the same.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionWhether to allow another request type to borrow a slot from this request rate limiter.Handles an incoming request.
-
Field Details
-
UNLIMITED
-
-
Constructor Details
-
RequestRateLimiter
-
-
Method Details
-
handleRequest
Handles an incoming request. returns a metadata object representing the metadata for the acquired slot, if acquired. If a slot is not acquired, returns a null metadata object.- Throws:
InterruptedException
-
allowSlotBorrowing
Whether to allow another request type to borrow a slot from this request rate limiter. Typically works fine if there is a relatively lesser load on this request rate limiter's type compared to the others (think of skew).- Returns:
- returns a metadata object for the acquired slot, if acquired. If the slot was not acquired, returns a metadata object with a null pool.
- Throws:
InterruptedException- WARNING: This API is experimental and might change in incompatible ways in the next release.
- -- Can cause slots to be blocked if a request borrows a slot and is itself long lived.
-
getRateLimiterConfig
-