Package

com.criteo

cuttle

Permalink

package cuttle

Core cuttle concepts are defined here.

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

Type Members

  1. class CancellationListener extends AnyRef

    Permalink

    Allows to unsubscribe a cancel listener.

    Allows to unsubscribe a cancel listener. It is sometimes useful for long running executions to dettach the cancel listener to not leak any memory.

  2. sealed trait Completed extends AnyRef

    Permalink

    Used a return type for the Job side effect instead of Unit.

    Used a return type for the Job side effect instead of Unit.

    We use Future[Completed] instead of Future[Unit] to avoid mistakes in user code because of value discarding.

  3. case class DBLocation(host: String, port: Int) extends Product with Serializable

    Permalink

    Configuration of JDBC endpoint.

    Configuration of JDBC endpoint.

    host

    JDBC driver host

    port

    JDBC driver port

  4. case class DatabaseConfig(locations: Seq[DBLocation], database: String, username: String, password: String) extends Product with Serializable

    Permalink

    Configuration for the MySQL database used by Cuttle.

    Configuration for the MySQL database used by Cuttle.

    locations

    sequence of JDBC endpoints

    database

    JDBC database

    username

    JDBC username

    password

    JDBC password

  5. case class Execution[S <: Scheduling](id: String, job: Job[S], context: S.Context, streams: ExecutionStreams, platforms: Seq[ExecutionPlatform], projectName: String, projectVersion: String)(implicit executionContext: SideEffectThreadPool) extends Product with Serializable

    Permalink

    Executions are created by the Scheduler.

    Executions are created by the Scheduler.

    id

    The unique id for this execution. Guaranteed to be unique.

    job

    The Job for which this execution has been created.

    context

    The SchedulingContext for which this execution has been created.

    streams

    The execution streams are scoped stdout, stderr for the execution.

    platforms

    The available ExecutionPlatforms for this execution.

    executionContext

    The scoped scala.concurrent.ExecutionContext for this execution.

  6. trait ExecutionPlatform extends AnyRef

    Permalink

    An ExecutionPlatform provides controlled access to shared resources.

  7. trait ExecutionStreams extends AnyRef

    Permalink

    The scoped output streams for an Execution.

    The scoped output streams for an Execution. Allows the execution to log its output.

  8. class Executor[S <: Scheduling] extends MetricProvider[S]

    Permalink

    An Executor is responsible to actually execute the SideEffect functions for the given Executions.

  9. case class Job[S <: Scheduling](id: String, scheduling: S, name: String = "", description: String = "", tags: Set[Tag] = Set.empty[Tag])(effect: SideEffect[S]) extends Product with Serializable

    Permalink

    The job SideEffect is the most important part as it represents the real job logic to execute.

    The job SideEffect is the most important part as it represents the real job logic to execute. A job is defined for a given Scheduling, for example it can be a TimeSeries job. Jobs are also Workflow with a single vertice.

    S

    The kind of Scheduling used by this job.

    id

    The internal job id. It will be sued to track the job state in the database, so it must not change over time otherwise the job will be seen as a new one by the scheduler. That id, being technical, should only use valid characters such as [a-zA-Z0-9_-.]

    scheduling

    The scheduling configuration for the job. For example a TimeSeries job can be configured to be hourly or daily, etc.

    name

    The job name as displayed in the UI.

    description

    The job description as displayed in the UI.

    tags

    The job tags used to filter jobs in the UI.

    effect

    The job side effect, representing the real job execution.

  10. trait Logger extends AnyRef

    Permalink

    A logger used to output internal informations.

  11. trait RetryStrategy extends AnyRef

    Permalink

    The strategy to use to retry stuck executions.

    The strategy to use to retry stuck executions.

    When an Execution fails, the Executor keeps a track of this failure in a list of recently failed Executions.

    If the Scheduler asks for the same Execution (same here is defined as an execution for the same Job and the same SchedulingContext) during the retryWindow defined by this strategy, it will be considered by the Executor as a stuck execution and delayed for the duration computed by the configured RetryStrategy.

  12. trait Scheduler[S <: Scheduling] extends MetricProvider[S]

    Permalink

    A scheduler interpret a Workflow and instanciate Executions for all defined Jobs.

    A scheduler interpret a Workflow and instanciate Executions for all defined Jobs. For example, a typical cuttle Scheduler is the TimeSeries scheduler that executes the graph for each time partition.

    S

    The king of Scheduling managed by this Scheduler.

  13. trait Scheduling extends AnyRef

    Permalink

    Represent a type of scheduling.

    Represent a type of scheduling. A typical cuttle scheduling is TimeSeries for example, that is a scheduling based on a calendar.

  14. trait SchedulingContext extends AnyRef

    Permalink

    A scheduling context is the input given to each Execution that will be created for a given Scheduling.

    A scheduling context is the input given to each Execution that will be created for a given Scheduling. For example, for a TimeSeries scheduling the context contain the time partition for which the job is running.

  15. type SideEffect[S <: Scheduling] = (Execution[S]) ⇒ Future[Completed]

    Permalink

    The side effect function represents the real job execution.

    The side effect function represents the real job execution. It returns a Future[Completed] to indicate the execution result (we use Completed here instead of Unit to avoid automatic value discarding, but Completed do not maintain additional state).

    The cuttle Executor ensures that a scheduled side effect for a given SchedulingContext will be run a least once, but cannot guarantee that it will be run exactly once. That's why the side effect function must be idempotent, meaning that if executed for the same SchedulingContext it must produce the same result.

    A failed future means a failed execution.

  16. case class Tag(name: String, description: String = "") extends Product with Serializable

    Permalink

    Allow to tag a job.

    Allow to tag a job. Tags can be used in the UI/API to filter jobs and more easily retrieve them.

    name

    Tag name as displayed in the UI.

    description

    Description as displayed in the UI.

  17. trait Workload[S <: Scheduling] extends AnyRef

    Permalink

    Represent the workload of a Cuttle project, ie.

    Represent the workload of a Cuttle project, ie. the list of jobs to be scheduled in some ways.

  18. type XA = Transactor[IO]

    Permalink

    Doobie transactor.

    Doobie transactor. See https://github.com/tpolecat/doobie.

Value Members

  1. object Auth

    Permalink

    The cuttle API is private for any write operation while it is publicly open for any read only operation.

    The cuttle API is private for any write operation while it is publicly open for any read only operation. It allows to make it easy to build tooling that monitor any running cuttle scheduler while restricting access to potentially dangerous operations.

    The UI access itself requires authentication.

  2. object Completed extends Completed with Product with Serializable

    Permalink

    The object to use to successfully complete a job side effect.

    The object to use to successfully complete a job side effect.

    Future.successful(Completed)
  3. object DatabaseConfig extends Serializable

    Permalink

    Utilities for DatabaseConfig.

  4. object ExecutionCancelled extends RuntimeException

    Permalink

    Used to fail an execution Future when the execution has been cancelled.

  5. object Job extends Product with Serializable

    Permalink

    Companion object for Job.

  6. object Metrics

    Permalink

    Expose cuttle metrics via the prometheus protocol.

  7. object Queries

    Permalink
  8. object RetryStrategy

    Permalink

    Built-in RetryStrategy

  9. object SchedulingContext

    Permalink

    Utilities for SchedulingContext

  10. object Tag extends Serializable

    Permalink
  11. object ThreadPools

    Permalink
  12. package events

    Permalink
  13. implicit val logger: Logger { def logMe(message: => String,level: String): Unit }

    Permalink

    Default implicit logger that output everything to stdout

  14. package platforms

    Permalink

    Defines useful ExecutionPlatforms:

    Defines useful ExecutionPlatforms:

    • local to fork process locally in a managed way.
    • http to make HTTP calls with rate limiting.
  15. implicit def scopedExecutionContext(implicit execution: Execution[_]): ExecutionContext

    Permalink

    Automatically provide a scala scala.concurrent.ExecutionContext for a given Execution.

    Automatically provide a scala scala.concurrent.ExecutionContext for a given Execution. The threadpool will be chosen carefully by the Executor.

  16. package utils

    Permalink

    A set of basic utilities useful to write workflows.

Inherited from AnyRef

Inherited from Any

Ungrouped