Packages

  • package root
    Definition Classes
    root
  • package com
    Definition Classes
    root
  • package spotify
    Definition Classes
    com
  • package scio
    Definition Classes
    spotify
  • package extra
    Definition Classes
    scio
  • object Iterators

    Utilities for Scala iterators.

    Utilities for Scala iterators.

    Adds a timeSeries method to Iterator[T] so that it can be windowed with different logic.

    import com.spotify.scio.extra.Iterators._
    
    case class Event(user: String, action: String, timestamp: Long)
    val i: Iterator[Event] = // ...
    
    // 60 minutes fixed windows offset by 30 minutes
    // E.g. minute [30, 90), [90, 120), [120, 150), [150, 180) ...
    i.timeSeries(_.timestamp).fixed(3600000, 1800000)
    
    // session windows with 60 minute gaps between windows
    i.timeSeries(_.timestamp).session(3600000)
    
    // 60 minutes sliding windows, one every 10 minutes, offset by 5 minutes
    // E.g. minute [5, 65), [15, 75), [25, 85), [35, 95) ...
    i.timeSeries(_.timestamp).session(3600000, 600000, 300000)
    Definition Classes
    extra
  • RichIterator
  • TimeSeriesIterator
c

com.spotify.scio.extra.Iterators

TimeSeriesIterator

class TimeSeriesIterator[T] extends AnyRef

Iterator for time series data.

Source
Iterators.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TimeSeriesIterator
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  9. def fixed(size: Long, offset: Long = 0L): Iterator[Seq[T]]

    Iterator of fixed-size timestamp-based windows.

    Iterator of fixed-size timestamp-based windows. Partitions the timestamp space into half-open intervals of the form [N * size + offset, (N + 1) * size + offset).

  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. def session(gapDuration: Long): Iterator[Seq[T]]

    Iterator of sessions separated by gapDuration-long periods with no elements.

  17. def sliding(size: Long, period: Long = 1L, offset: Long = 0L): Iterator[Seq[T]]

    Iterator of possibly overlapping fixed-size timestamp-based windows.

    Iterator of possibly overlapping fixed-size timestamp-based windows. Partitions the timestamp space into half-open intervals of the form [N * period + offset, N * period + offset + size).

  18. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    AnyRef → Any
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  22. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped