Class SessionWindowCollection<T>

java.lang.Object
com.scaleoutsoftware.collections.timewindowing.WindowingCollection<T>
com.scaleoutsoftware.collections.timewindowing.SessionWindowCollection<T>
Type Parameters:
T - the object type of the source collection.
All Implemented Interfaces:
Iterable<TimeWindow<T>>

public class SessionWindowCollection<T> extends WindowingCollection<T>
The SessionWindowCollection transforms a List into an iterable collection of session windows. This wrapper class can be used to manage the retention policy of the source collection as well as to insert new objects in chronological order. The difference between SessionWindowCollection and WatermarkedSessionWindowCollection is that windows in the WatermarkedSessionWindowCollection can be closed if the watermark passes the inclusive end of a window.
  • Constructor Details

    • SessionWindowCollection

      public SessionWindowCollection(List<T> sourceCollection, TimestampSelector<T> timestampSelector, long startTimeMs, long timeoutMs)
      Instantiates a new SessionWindowCollection
      Parameters:
      sourceCollection - the underlying source collection collection.
      timestampSelector - the TimestampSelector is used to pull a timestamp from an item in the source collection and subsequent insertions.
      startTimeMs - the first time an object can be in a time window -- items before the start time will be evicted. The start time is also the start time of the first time window.
      timeoutMs - the minimum amount of time between session windows in milliseconds.
  • Method Details