Packages

package workflow

A Workflow is a graph of atomic operations, with WorkflowOps for the vertices. We crush them down into a WorkflowTask. This crush gives us a location to optimize our workflow decisions. EG, A sequence of simple ops may be combined into a single pipeline request, but if one of those operations contains JS, we have to execute that outside of a pipeline, possibly reordering the other operations to avoid having two pipelines with a JS operation in the middle.

We also implement the optimizations atomic http://docs.mongodb.org/manual/core/aggregation-pipeline-optimization/ so that we can build others potentially on top of them (including reordering non-pipelines around pipelines, etc.).

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

Type Members

  1. final case class $AddFieldsF[A](src: A, shape: Reshape[ExprOp]) extends WorkflowOp3_4F[A] with Product with Serializable
  2. final case class $FlatMapF[A](src: A, fn: AnonFunDecl, scope: Scope) extends MapReduceF[A] with Product with Serializable

    Takes a function of two parameters.

    Takes a function of two parameters. The first is the current key (which defaults to this._id, but may have been overridden by previous [Flat]$MapFs) and the second is the document itself. The function must return an array of 2-element arrays, each containing a new key and a new value.

  3. final case class $FoldLeftF[A](head: A, tail: NonEmptyList[A]) extends WorkflowOpCoreF[A] with Product with Serializable

    Performs a sequence of operations, sequentially, merging their results.

  4. final case class $GeoNearF[A](src: A, near: (slamdata.Predef.Double, slamdata.Predef.Double), distanceField: BsonField, limit: slamdata.Predef.Option[slamdata.Predef.Int], maxDistance: slamdata.Predef.Option[slamdata.Predef.Double], query: slamdata.Predef.Option[Selector], spherical: slamdata.Predef.Option[slamdata.Predef.Boolean], distanceMultiplier: slamdata.Predef.Option[slamdata.Predef.Double], includeLocs: slamdata.Predef.Option[BsonField], uniqueDocs: slamdata.Predef.Option[slamdata.Predef.Boolean]) extends WorkflowOpCoreF[A] with Product with Serializable
  5. final case class $GroupF[A](src: A, grouped: Grouped[ExprOp], by: Shape[ExprOp]) extends WorkflowOpCoreF[A] with Product with Serializable
  6. final case class $LimitF[A](src: A, count: slamdata.Predef.Long) extends WorkflowOpCoreF[A] with Product with Serializable
  7. final case class $LookupF[A](src: A, from: CollectionName, localField: BsonField, foreignField: BsonField, as: BsonField) extends WorkflowOpCoreF[A] with Product with Serializable
  8. final case class $MapF[A](src: A, fn: AnonFunDecl, scope: Scope) extends MapReduceF[A] with Product with Serializable

    Takes a function of two parameters.

    Takes a function of two parameters. The first is the current key (which defaults to this._id, but may have been overridden by previous [Flat]$MapFs) and the second is the document itself. The function must return a 2-element array containing the new key and new value.

  9. final case class $MatchF[A](src: A, selector: Selector) extends WorkflowOpCoreF[A] with Product with Serializable
  10. final case class $OutF[A](src: A, collection: CollectionName) extends WorkflowOpCoreF[A] with Product with Serializable

    TODO: If an $OutF has anything after it, we need to either do

    TODO: If an $OutF has anything after it, we need to either do

    $seq($out(src, dst), after($read(dst), ...))

    or

    $Fork(src, List($out(_, dst), after(_, ...)))

    The latter seems preferable, but currently the forking semantics are not clear.

  11. final case class $ProjectF[A](src: A, shape: Reshape[ExprOp], idExclusion: IdHandling) extends WorkflowOpCoreF[A] with Product with Serializable
  12. final case class $PureF(value: Bson) extends WorkflowOpCoreF[slamdata.Predef.Nothing] with Product with Serializable
  13. final case class $ReadF(coll: Collection) extends WorkflowOpCoreF[slamdata.Predef.Nothing] with Product with Serializable
  14. final case class $RedactF[A](src: A, value: Fix[ExprOp]) extends WorkflowOpCoreF[A] with Product with Serializable
  15. final case class $ReduceF[A](src: A, fn: AnonFunDecl, scope: Scope) extends MapReduceF[A] with Product with Serializable

    Takes a function of two parameters – a key and an array of values.

    Takes a function of two parameters – a key and an array of values. The function must return a single value.

  16. final case class $SampleF[A](src: A, size: slamdata.Predef.Int) extends WorkflowOpCoreF[A] with Product with Serializable
  17. final case class $SimpleMapF[A](src: A, exprs: NonEmptyList[CardinalExpr[JsFn]], scope: Scope) extends MapReduceF[A] with Product with Serializable
  18. final case class $SkipF[A](src: A, count: slamdata.Predef.Long) extends WorkflowOpCoreF[A] with Product with Serializable
  19. final case class $SortF[A](src: A, value: NonEmptyList[(BsonField, SortDir)]) extends WorkflowOpCoreF[A] with Product with Serializable
  20. final case class $UnwindF[A](src: A, field: DocVar, includeArrayIndex: slamdata.Predef.Option[Name], preserveNullAndEmptyArrays: slamdata.Predef.Option[slamdata.Predef.Boolean]) extends WorkflowOpCoreF[A] with Product with Serializable
  21. sealed abstract class CardinalExpr[A] extends AnyRef
  22. trait Classify[F[_]] extends Serializable
  23. trait Coalesce[F[_]] extends Serializable
  24. trait Crush[F[_]] extends Serializable

    Operations that are applied to a completed workflow to produce an executable WorkflowTask.

    Operations that are applied to a completed workflow to produce an executable WorkflowTask. NB: when this is applied, information about the the type of plan (i.e. the required MongoDB version) is discarded.

  25. trait Crystallize[F[_]] extends Serializable
  26. final case class Crystallized[F[_]](op: Fix[F]) extends Product with Serializable

    A type for a Workflow which has had crystallize applied to it.

  27. type FixOp[F[_]] = (Fix[F]) ⇒ Fix[F]
  28. final case class FlatExpr[A](fn: A) extends CardinalExpr[A] with Product with Serializable
  29. sealed abstract class IdHandling extends AnyRef
  30. final case class MapExpr[A](fn: A) extends CardinalExpr[A] with Product with Serializable
  31. sealed abstract class MapReduceF[A] extends WorkflowOpCoreF[A]
  32. abstract class PipelineF[F[_], A] extends SingleSourceF[F, A]

    Newtype for ops which can appear in aggregation pipeline.

  33. final case class PipelineOp(op: WorkflowF[slamdata.Predef.Unit], bson: Doc) extends Product with Serializable

    A "newtype" for ops that appear in pipelines, for use mostly after a workflow is constructed, with fixed type that can represent any workflow.

  34. trait Refs[F[_]] extends Serializable
  35. abstract class RewriteRefs[F[_]] extends AnyRef
  36. abstract class ShapePreservingF[F[_], A] extends PipelineF[F, A]

    Newtype for ops which preserve the shape of the input.

  37. abstract class SingleSourceF[F[_], A] extends AnyRef

    Newtype for ops which have a single source op.

  38. final case class SourceF[F[_], A](wf: F[A]) extends Product with Serializable

    Newtype for source ops (that is, ops that are themselves sources).

  39. final case class SubExpr[A](place: A, fn: A) extends CardinalExpr[A] with Product with Serializable

    Like MapExpr, but stores the result of fn in place (which must be assignable).

  40. type Workflow = Fix[WorkflowF]
  41. type Workflow3_2F[A] = WorkflowOpCoreF[A]

    The type for workflows targeting MongoDB 3.2 specifically.

  42. type Workflow3_4F[A] = Coproduct[WorkflowOp3_4F, WorkflowOpCoreF, A]

    The type for workflows targeting MongoDB 3.4 specifically.

  43. type WorkflowF[A] = Coproduct[WorkflowOp3_4F, WorkflowOpCoreF, A]

    The type for workflows supporting the most advanced capabilities.

  44. sealed abstract class WorkflowOp3_4F[+A] extends slamdata.Predef.Product with slamdata.Predef.Serializable

    Ops that are provided by MongoDB since 3.4.

  45. sealed abstract class WorkflowOpCoreF[+A] extends slamdata.Predef.Product with slamdata.Predef.Serializable

    Ops that are provided by all supported MongoDB versions (since 3.2), or are internal to quasar and supported everywhere.

Value Members

  1. val ExprName: Name

    MapReduce result expression key.

  2. val ExprVar: DocVar
  3. val IdName: Name

    MapReduce result identity key.

  4. val IdVar: DocVar
  5. val QuasarSigilName: Name

    Quasar result sigil.

  6. val QuasarSigilVar: DocVar
  7. val W34: Inject[WorkflowOp3_4F, WorkflowF]
  8. val WC: Inject[WorkflowOpCoreF, WorkflowF]
  9. def chain[A](src: A, op1: (A) ⇒ A, ops: (A) ⇒ A*): A

    Flattens the sequence of operations like so:

    Flattens the sequence of operations like so:

    chain(
      $read(Path.fileAbs("foo")),
      $match(Selector.Where(Js.Bool(true))),
      $limit(7))
    val read = $read(Path.fileAbs("foo"))
    val match = $match(Selector.Where(Js.Bool(true))(read)
    $limit(7)(match)
  10. def coalesceAll[F[_]](implicit arg0: Functor[F], I: :<:[WorkflowOpCoreF, F]): Coalesce[F]
  11. implicit def crystallizeWorkflowF[F[_]](implicit arg0: Functor[F], arg1: Classify[F], arg2: Coalesce[F], arg3: Refs[F], I: :<:[WorkflowOpCoreF, F], ev1: :<:[F, WorkflowF], ev2: Uni[ExprOp]): Crystallize[F]
  12. def prefixBase(base: DocVar): slamdata.Predef.PartialFunction[DocVar, DocVar]
  13. def simpleShape[F[_]](op: Fix[F])(implicit I: :<:[F, WorkflowF]): slamdata.Predef.Option[slamdata.Predef.List[Name]]
  14. def simpleShape32[F[_]](wf: WorkflowOpCoreF[Fix[F]])(implicit I: :<:[F, WorkflowF]): slamdata.Predef.Option[slamdata.Predef.List[Name]]
    Annotations
    @SuppressWarnings()
  15. def simpleShape34[F[_]](wf: WorkflowOp3_4F[Fix[F]])(implicit I: :<:[F, WorkflowF]): slamdata.Predef.Option[slamdata.Predef.List[Name]]
    Annotations
    @SuppressWarnings()
  16. def task[F[_]](fop: Crystallized[F])(implicit arg0: Functor[F], C: Crush[F]): WorkflowTask
  17. def toPipelineOp[F[_], A](op: PipelineF[F, A], base: DocVar)(implicit arg0: Functor[F], I: :<:[F, WorkflowF]): PipelineOp
  18. implicit def workflowFCrush(implicit I: :<:[WorkflowOpCoreF, WorkflowF]): Crush[WorkflowF]
  19. implicit def workflowRenderTree[T[_[_]], F[_]](implicit arg0: RecursiveT[T], arg1: Traverse[F], arg2: Classify[F], ev0: :<:[WorkflowOpCoreF, F], ev1: RenderTree[F[slamdata.Predef.Unit]]): RenderTree[T[F]]
  20. object $FlatMapF extends Serializable
  21. object $MapF extends Serializable
  22. object $ProjectF extends Serializable
  23. object $RedactF extends Serializable
  24. object $ReduceF extends Serializable
  25. object $SimpleMapF extends Serializable
  26. object $SortF extends Serializable
  27. object $addFields
  28. object $flatMap
  29. object $foldLeft
  30. object $geoNear
  31. object $group
  32. object $limit
  33. object $lookup
  34. object $map
  35. object $match
  36. object $out
  37. object $project
  38. object $pure
  39. object $read
  40. object $redact
  41. object $reduce
  42. object $sample
  43. object $simpleMap
  44. object $skip
  45. object $sort
  46. object $unwind
  47. object CardinalExpr
  48. object Classify extends Serializable
  49. object Coalesce extends Serializable
  50. object Crush extends Serializable
  51. object Crystallize extends Serializable
  52. object Crystallized extends Serializable
  53. object ExcludeId extends IdHandling with Product with Serializable
  54. object IdHandling
  55. object IgnoreId extends IdHandling with Product with Serializable
  56. object IncludeId extends IdHandling with Product with Serializable
  57. object IsPipeline
  58. object IsShapePreserving
  59. object IsSingleSource
  60. object IsSource
  61. object PipelineOp extends Serializable
  62. object PipelineOpCore
  63. object Refs extends Serializable
  64. object WorkflowOp3_4F extends Serializable
  65. object WorkflowOpCoreF extends Serializable
  66. object needsMapBeforeSort

Inherited from AnyRef

Inherited from Any

Ungrouped