C# (CSharp) Orleans.KafkaStreamProvider.KafkaQueue.TimedQueueCache Namespace

Сlasses

Name Description
TimedQueueAdapterCache
TimedQueueCache The TimedQueueCache works similarly to the SimpleQueueCache but it also has a Timespan which is used as an expiration and retention time. I.e, only items that expire their Timespan (and were consumed by all cursors of course) are allowed to be removed from the cache. That way the cache always guarantees to hold all the items that were inserted in a certain Timespan (for example if the Timespan is 1 hour, all the messages that were inserted in the last hour will remain in the cache, with no regard if they were consumed or not). The TimedQueueCache also offers to hold a callback for when items are being removed from the cache and also allows to define an interval for how many items need to be removed before the callback is called.
TimedQueueCacheBucket For backpressure detection we maintain a histogram of 10 buckets. Every buckets records how many items are in the cache in that bucket and how many cursors are pointing to an item in that bucket. In the TimedCache the bucket also takes note what is the newest and oldest members timespan because buckets also has a maximum timespan they can hold (this is done for better bucket distribution) We update the NumCurrentItems, NewestMemberTimespan and OldestMemberTimespan (when it's a new bucket) when we add and remove cache item (potentially opening or removing a bucket) We update NumCurrentCursors every time we move a cursor If the first (most outdated bucket) has at least one cursor pointing to it, we say we are under back pressure (in a full cache).
TimedQueueCacheCursor The TimedQueueCacheCursor is at the moment identical to SimpleQueueCache cursor. We are not using the SimpleCacheCursor in order to be able to extend the CacheCursor without considering the SimpleQueueCache.
TimedQueueCacheItem The TimedQueueCacheItems is similar to the SimpleQueueCacheItem, but it also holds a Timestamp so we will know how long the message is in the cache.