Skip to content

Instantly share code, notes, and snippets.

@andypetrella
Last active August 29, 2015 14:04
Show Gist options
  • Save andypetrella/12228eb24eea6b3e1389 to your computer and use it in GitHub Desktop.
Save andypetrella/12228eb24eea6b3e1389 to your computer and use it in GitHub Desktop.
CRDD
trait CRDD[S<:Space] {
def continuum:S
def break:S#SpacePoint => (S#SpacePoint, S#SpacePoint)
// the rest follow more or less the DStream definition
}
object CRDDs {
trait DStream extends CRDD[ElapsedTime] {
val continuum: ElapsedTime
val break: TimePoint => Inteval /*(TimePoint, TimePoint)*/ // using slideDuration f.i.
}
trait TsCRDD extends CRDD[EventHorizon] {}
// a continuum composed of events, each holding a field like timestamp that can order them
val continuum: EventHorizon
val break: TimePoint /*timestamp*/ => Interval
}
trait CountCRDD extends CRDD[Integers] {
val continuum = Integers // 1, 2, 3, ... the counts
val break = Int => (Int, Int) // a split every n events [1, 4], [5, 8], ...
}
}
trait JobGenerator {
//an Observable type that can generate points based on a given semantic/strategy
// the handler registered to this producer will use the chopper and outlierManager function based on the cases
// like in DStream the "events" are sent to a Actor, in our case the type of the message will depend on these functions
def spacePointProducer
def chopper:SpacePoint => Boolean
def outliers:CRDD[SpacePoint] // ???
}
trait Space {
type SpacePoint
def origin: SpacePoint
def next: SpacePoint=>SpacePoint
def ordering:Ordering[SpacePoint]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment