class FloodThrottler extends Object
Tracks recent flood frequency for each key to prevent excessive flooding of the same data. Implements simple rate limiting with configurable thresholds and automatic cleanup of expired counters.
Offers lightweight DOS protection by rejecting flood operations that exceed maximum frequency limits within a time window. This is a partial solution and should be used in conjunction with other security mechanisms for comprehensive protection.
| Constructor and Description |
|---|
FloodThrottler()Creates a new FloodThrottler |
| Modifier and Type | Method and Description |
|---|---|
(package private) void | cancel()Stop the periodic cleaner. |
(package private) boolean | shouldThrottle(Hash h)Increments the counter and checks if the hash should be throttled |
void cancel()
boolean shouldThrottle(Hash h)
h - the hash to check