com.twitter

collection

package collection

Visibility
  1. Public
  2. All

Type Members

  1. class BucketGenerationalQueue[A] extends GenerationalQueue[A]

    Improved GenerationalQueue: using a list of buckets responsible for containing elements belonging to a slice of time.

    Improved GenerationalQueue: using a list of buckets responsible for containing elements belonging to a slice of time. For instance: 3 Buckets, First contains elements from 0 to 10, second elements from 11 to 20 and third elements from 21 to 30 We expand the list when we need a new bucket, and compact the list to stash all old buckets into one. There is a slightly difference with the other implementation, when we collect elements we only choose randomly an element in the oldest bucket, as we don't have activity date in this bucket we consider the worst case and then we can miss some expired elements by never find elements that aren't expired.

  2. class ExactGenerationalQueue[A] extends GenerationalQueue[A]

    Generational Queue keep track of elements based on their last activity.

    Generational Queue keep track of elements based on their last activity. You can refresh activity of an element by calling touch(a: A) on it. There is 2 ways of retrieving old elements: - collect(age: Duration) collect the oldest element (age of elem must be > age) - collectAll(age: Duration) collect all the elements which age > age in parameter

  3. trait GenerationalQueue[A] extends AnyRef

Ungrouped