THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||
---|---|---|
| ||
class ProducerIdQuotaManager[K, V](disposalSchedulerIntervalMs: Long, cleanupScheduler: Scheduler) {
protected val concurrentMap: ConcurrentHashMap[K
, TimedBloomFilter[V]] = new ConcurrentHashMap()
protect val schedulerIntervalMs = new AtomicLong(disposalSchedulerIntervalMs)
cleanupScheduler.schedule("cleanup-keys", () => {
// Cleanup Keys that doesn't have empty TimedBloomFilter
}, 0L, schedulerIntervalMs)
def disposalSchedulerIntervalMs(intervalMs: Long): Unit = {
disposalSchedulerIntervalMs(intervalMs)
}
def add(key: K, value: V): ControlledCachedMap[K, V] = {
// Add value to the key bloom filter
}
def containsKeyValuePair(key: K, value: V): Boolean = {
// Check if key, value exist in the cache
}
}
|
...