object 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)
- Source
- Iterators.scala
- Alphabetic
- By Inheritance
- Iterators
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- implicit final class RichIterator[T] extends AnyVal
Enhance Iterator by adding a
timeSeries
method. - class TimeSeriesIterator[T] extends AnyRef
Iterator for time series data.
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()