Package

com.criteo.cuttle

timeseries

Permalink

package timeseries

A TimeSeries scheduler executes the Workflow for the time partitions defined in a calendar. Each Job defines how it mnaps to the calendar (for example Hourly or Daily UTC), and the Scheduler ensure that at least one Execution is created and successfully run for each defined Job/Period.

The scheduler also allow to Backfill already computed partitions. The Backfill can be recursive or not and an audit log of backfills is kept.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. timeseries
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class Backfill(id: String, start: Instant, end: Instant, jobs: Set[Job[TimeSeries]], priority: Int, name: String, description: String, status: String, createdBy: String) extends Product with Serializable

    Permalink

    A Backfill allows to recompute already computed time partitions in the past.

    A Backfill allows to recompute already computed time partitions in the past.

    id

    Unique id for the backfill.

    start

    Start instant for the partitions to backfill.

    end

    End instant for the partitions to backfill.

    jobs

    Indicates the part of the graph to backfill.

    priority

    The backfill priority. If minus than 0 it is less priority than the day to day workload. If more than 0 it becomes more prioritary and can delay the day to day workload.

    description

    Description (for audit logs).

    status

    Status of the backfill.

    createdBy

    User who created the backfill (for audit logs).

  2. class CuttleProject extends AnyRef

    Permalink

    A cuttle project is a workflow to execute with the appropriate scheduler.

    A cuttle project is a workflow to execute with the appropriate scheduler. See the CuttleProject companion object to create projects.

  3. implicit final class SafeLiteralDate extends AnyVal

    Permalink

    Utility that allow to define compile time safe date literals.

    Utility that allow to define compile time safe date literals. Meaning that compilation will fail if the date literal cannot be parsed into a UTC instant.

    val start = date"2017-09-01T00:00:00Z"
  4. case class TimeSeries(calendar: TimeSeriesCalendar, start: Instant, end: Option[Instant] = None, batching: TimeSeriesBatching = TimeSeriesBatching.default) extends Scheduling with Product with Serializable

    Permalink

    Configure a Job as a TimeSeries job,

    Configure a Job as a TimeSeries job,

    calendar

    The calendar partitions configuration for this job (for example hourly or daily).

    start

    The start instant at which this job must start being executed.

    batching

    The batching parameters com.criteo.cuttle.timeseries.TimeSeriesBatching.

  5. case class TimeSeriesBatching(size: Int, delay: Duration) extends Product with Serializable

    Permalink

    The maximum number of partitions the job can handle at once and a delay the scheduler will wait for partition to arrive.

    The maximum number of partitions the job can handle at once and a delay the scheduler will wait for partition to arrive. If the size is defined to a value more than 1, the scheduler will wait for delay trigger Execution with a scheduling context extended to by the @size.

    size

    the maximum number of joint intervals which are going to be run within single execution.

    delay

    the delay for which the scheduler will wait for the new executions to arrive for current batch.

  6. sealed trait TimeSeriesCalendar extends AnyRef

    Permalink

    Represents calendar partitions for which a job will be run by the TimeSeriesScheduler.

    Represents calendar partitions for which a job will be run by the TimeSeriesScheduler. See the companion object for the available calendars.

  7. case class TimeSeriesContext(start: Instant, end: Instant, backfill: Option[Backfill] = None, projectVersion: String = "") extends SchedulingContext with Product with Serializable

    Permalink

    A TimeSeriesContext is passed to Executions initiated by the TimeSeriesScheduler.

    A TimeSeriesContext is passed to Executions initiated by the TimeSeriesScheduler.

    start

    Start instant of the partition to compute.

    end

    End instant of the partition to compute.

    backfill

    If this execution is for a backfill, the Backfill informations are provided.

  8. case class TimeSeriesDependency(offsetLow: Duration, offsetHigh: Duration) extends Product with Serializable

    Permalink

    A TimeSeriesDependency qualify the dependency between 2 Jobs in a TimeSeries Workflow.

    A TimeSeriesDependency qualify the dependency between 2 Jobs in a TimeSeries Workflow. It can be configured to offset the dependency.

    Supposing job1 depends on job2 with dependency descriptor (offsetLow, offsetHigh). Then to execute period (low, high) of job1, we need period (low+offsetLow, high+offsetHigh) of job2.

    offsetLow

    the offset for the low end of the duration

    offsetHigh

    the offset for the high end of the duration

  9. case class TimeSeriesScheduler(logger: Logger, stateRetention: Option[Duration] = None, maxVersionsHistory: Option[Int] = None) extends Scheduler[TimeSeries] with Product with Serializable

    Permalink

    A TimeSeriesScheduler executes the Workflow for the time partitions defined in a calendar.

    A TimeSeriesScheduler executes the Workflow for the time partitions defined in a calendar. Each Job defines how it mnaps to the calendar (for example Hourly or Daily UTC), and the Scheduler ensure that at least one Execution is created and successfully run for each defined Job/Period.

    The scheduler also allow to Backfill already computed partitions. The Backfill can be recursive or not and an audit log of backfills is kept.

  10. trait Workflow extends Workload[TimeSeries]

    Permalink

    A timeseries workflow

Value Members

  1. object CuttleProject

    Permalink

    Create new projects using a timeseries scheduler.

  2. object TimeSeries extends Serializable

    Permalink

    TimeSeries utilities.

  3. object TimeSeriesBatching extends Serializable

    Permalink
  4. object TimeSeriesCalendar

    Permalink

    Define the available calendars.

  5. object TimeSeriesContext extends Serializable

    Permalink
  6. object TimeSeriesUtils

    Permalink
  7. object Workflow

    Permalink

    Utilities for Workflow.

  8. package contrib

    Permalink
  9. def daily(tz: ZoneId, start: Instant, end: Option[Instant] = None, batching: TimeSeriesBatching = TimeSeriesBatching.default): TimeSeries

    Permalink

    Defines an daily calendar starting at the specified instant, and using the specified time zone.

    Defines an daily calendar starting at the specified instant, and using the specified time zone. Days are defined as complete calendar days starting a midnight and during 24 hours. If the specified timezone defines lightsaving it is possible that some days are 23 or 25 horus thus.

    If the start instant does not match a round day (midnight), the calendar will actually start the next day immediatly following the start instant.

    The optional end instant allows to specify a finite calendar that will stop on the end instant if it is a round day or at the start of the day otherwise.

    tz

    The time zone for which these _days_ are defined.

    start

    The instant this calendar will start.

    end

    The optional instant this calendar will end.

  10. implicit val defaultDependencyDescriptor: TimeSeriesDependency

    Permalink

    Defines an implicit default dependency descriptor for TimeSeries graphs.

    Defines an implicit default dependency descriptor for TimeSeries graphs. The default is offsetLow = 0, offsetHigh = 0.

  11. def hourly(start: Instant, end: Option[Instant] = None, batching: TimeSeriesBatching = TimeSeriesBatching.default): TimeSeries

    Permalink

    Defines an hourly calendar starting at the specified instant.

    Defines an hourly calendar starting at the specified instant. Hours are defined as complete calendar hours starting at 00 minutes, 00 seconds.

    If the start instant does not match a round hour (0 minutes, 0 seconds), the calendar will actually start the next hour immediatly following the start instant.

    The optional end instant allows to specify a finite calendar that will stop on the end instant if it is a round hour or at the start of the hour otherwise.

    start

    The instant this calendar will start.

    end

    The optional instant this calendar will end.

  12. implicit def jobAsWorkflow(job: Job[TimeSeries]): Workflow

    Permalink

    Convert a single job to Workflow of a single job.

  13. implicit val m1: MeasureKey[Interval[Instant], JobState]

    Permalink
  14. implicit val m2: MeasureKey[Interval[Instant], Unit]

    Permalink
  15. implicit val m3: MeasureKey[Interval[Instant], Int]

    Permalink
  16. implicit val m4: MeasureKey[Interval[Instant], TimeSeriesJob]

    Permalink
  17. implicit val m5: MeasureKey[Interval[Instant], Option[Backfill]]

    Permalink
  18. def measure[A, B]: MeasureKey[Interval[A], B]

    Permalink
  19. def monthly(tz: ZoneId, start: Instant, end: Option[Instant] = None, batching: TimeSeriesBatching = TimeSeriesBatching.default): TimeSeries

    Permalink

    Defines a monthly calendar.

    Defines a monthly calendar. Months are defined as complete calendar months starting on the 1st day and during 28,29,30 or 31 days. The specified time zone is used to define the exact month start instant.

    If the start instant does not match a round month (1st at midnight), the calendar will actually start the next month immediatly following the start instant.

    The optional end instant allows to specify a finite calendar that will stop on the end instant if it is a round month or at the start of the month otherwise.

    tz

    The time zone for which these months are defined.

    start

    The instant this calendar will start.

    end

    The optional instant this calendar will end.

  20. def nhourly(hours: Int, start: Instant, end: Option[Instant] = None, batching: TimeSeriesBatching = TimeSeriesBatching.default): TimeSeries

    Permalink

    Defines a N-hourly calendar starting at the specified instant.

    Defines a N-hourly calendar starting at the specified instant.

    It is just a generalization of the hourly scheduling allowing to schedule intervals of n hours.

    hours

    The number of hours of the intervals. Can be any positive divider of 24 except 24.

    start

    The instant this calendar will start.

    end

    The optional instant this calendar will end.

  21. def safeLiteralDate(c: Context)(args: scala.reflect.macros.blackbox.Context.Expr[Any]*): scala.reflect.macros.blackbox.Context.Expr[Instant]

    Permalink
  22. def weekly(tz: ZoneId, start: Instant, end: Option[Instant] = None, batching: TimeSeriesBatching = TimeSeriesBatching.default): TimeSeries

    Permalink

    Defines a weekly calendar.

    Defines a weekly calendar. Weeks are defined as complete calendar weeks starting on a specific day of the week at midnight and lasting 7 days. The specified time zone is used to define the exact week start instant.

    The start instant is used to define the first day of the week for the weeks.

    If the start instant does not match a round week (midnight), the calendar will actually start the next week immediately following the start instant.

    The optional end instant allows to specify a finite calendar that will stop on the end instant if it is a round week or at the start of the week otherwise.

    tz

    The time zone for which these _weeks_ are defined.

    start

    The instant this calendar will start.

    end

    The optional instant this calendar will end.

Inherited from AnyRef

Inherited from Any

Ungrouped