class
BucketGenerationalQueue[A] extends GenerationalQueue[A]
Instance Constructors
-
new
BucketGenerationalQueue(timeout: Duration)
Type Members
-
class
TimeBucket[A] extends HashSet[A]
Value Members
-
final
def
!=(arg0: AnyRef): Boolean
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: AnyRef): Boolean
-
final
def
==(arg0: Any): Boolean
-
object
TimeBucket extends Serializable
-
def
add(a: A): Unit
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
def
collect(d: Duration): Option[A]
-
def
collectAll(d: Duration): Iterable[A]
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
def
remove(a: A): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
def
touch(a: A): Unit
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Inherited from AnyRef
Inherited from Any
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.