Package

quasar.physical.mongodb

workflow

Permalink

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
AnyRef, Any
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 $FlatMapF[A](src: A, fn: AnonFunDecl, scope: Scope) extends MapReduceF[A] with Product with Serializable

    Permalink

    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.

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

    Permalink

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

  3. 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

    Permalink
  4. final case class $GroupF[A](src: A, grouped: Grouped[ExprOp], by: Shape[ExprOp]) extends WorkflowOpCoreF[A] with Product with Serializable

    Permalink
  5. final case class $LimitF[A](src: A, count: slamdata.Predef.Long) extends WorkflowOpCoreF[A] with Product with Serializable

    Permalink
  6. final case class $LookupF[A](src: A, from: CollectionName, localField: BsonField, foreignField: BsonField, as: BsonField) extends WorkflowOp3_2F[A] with Product with Serializable

    Permalink
  7. final case class $MapF[A](src: A, fn: AnonFunDecl, scope: Scope) extends MapReduceF[A] with Product with Serializable

    Permalink

    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.

  8. final case class $MatchF[A](src: A, selector: Selector) extends WorkflowOpCoreF[A] with Product with Serializable

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

    Permalink

    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.

  10. final case class $ProjectF[A](src: A, shape: Reshape[ExprOp], idExclusion: IdHandling) extends WorkflowOpCoreF[A] with Product with Serializable

    Permalink
  11. final case class $PureF(value: Bson) extends WorkflowOpCoreF[slamdata.Predef.Nothing] with Product with Serializable

    Permalink
  12. final case class $ReadF(coll: Collection) extends WorkflowOpCoreF[slamdata.Predef.Nothing] with Product with Serializable

    Permalink
  13. final case class $RedactF[A](src: A, value: Fix[ExprOp]) extends WorkflowOpCoreF[A] with Product with Serializable

    Permalink
  14. final case class $ReduceF[A](src: A, fn: AnonFunDecl, scope: Scope) extends MapReduceF[A] with Product with Serializable

    Permalink

    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.

  15. final case class $SampleF[A](src: A, size: slamdata.Predef.Int) extends WorkflowOp3_2F[A] with Product with Serializable

    Permalink
  16. final case class $SimpleMapF[A](src: A, exprs: NonEmptyList[CardinalExpr[JsFn]], scope: Scope) extends MapReduceF[A] with Product with Serializable

    Permalink
  17. final case class $SkipF[A](src: A, count: slamdata.Predef.Long) extends WorkflowOpCoreF[A] with Product with Serializable

    Permalink
  18. final case class $SortF[A](src: A, value: NonEmptyList[(BsonField, SortDir)]) extends WorkflowOpCoreF[A] with Product with Serializable

    Permalink
  19. final case class $UnwindF[A](src: A, field: DocVar) extends WorkflowOpCoreF[A] with Product with Serializable

    Permalink
  20. sealed abstract class CardinalExpr[A] extends AnyRef

    Permalink
  21. trait Classify[F[_]] extends Serializable

    Permalink
  22. trait Coalesce[F[_]] extends Serializable

    Permalink
  23. trait Crush[F[_]] extends Serializable

    Permalink

    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.

  24. trait Crystallize[F[_]] extends Serializable

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

    Permalink

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

  26. type FixOp[F[_]] = (Fix[F]) ⇒ Fix[F]

    Permalink
  27. final case class FlatExpr[A](fn: A) extends CardinalExpr[A] with Product with Serializable

    Permalink
  28. sealed abstract class IdHandling extends AnyRef

    Permalink
  29. final case class MapExpr[A](fn: A) extends CardinalExpr[A] with Product with Serializable

    Permalink
  30. sealed abstract class MapReduceF[A] extends WorkflowOpCoreF[A]

    Permalink
  31. abstract class PipelineF[F[_], A] extends SingleSourceF[F, A]

    Permalink

    Newtype for ops which can appear in aggregation pipeline.

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

    Permalink

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

  33. trait Refs[F[_]] extends Serializable

    Permalink
  34. abstract class RewriteRefs[F[_]] extends AnyRef

    Permalink
  35. abstract class ShapePreservingF[F[_], A] extends PipelineF[F, A]

    Permalink

    Newtype for ops which preserve the shape of the input.

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

    Permalink

    Newtype for ops which have a single source op.

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

    Permalink

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

  38. type Workflow = Fix[WorkflowF]

    Permalink
  39. type Workflow2_6F[A] = WorkflowOpCoreF[A]

    Permalink

    The type for workflows targeting MongoDB 2.6 specifically.

  40. type Workflow3_2F[A] = Coproduct[WorkflowOp3_2F, WorkflowOpCoreF, A]

    Permalink

    The type for workflows targeting MongoDB 3.2 specifically.

  41. type WorkflowF[A] = Coproduct[WorkflowOp3_2F, WorkflowOpCoreF, A]

    Permalink

    The type for workflows supporting the most advanced capabilities.

  42. sealed abstract class WorkflowOp3_2F[+A] extends AnyRef

    Permalink

    Ops that are provided by MongoDB since 3.2.

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

    Permalink

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

Value Members

  1. object $FlatMapF extends Serializable

    Permalink
  2. object $MapF extends Serializable

    Permalink
  3. object $ProjectF extends Serializable

    Permalink
  4. object $RedactF extends Serializable

    Permalink
  5. object $ReduceF extends Serializable

    Permalink
  6. object $SimpleMapF extends Serializable

    Permalink
  7. object $SortF extends Serializable

    Permalink
  8. object $flatMap

    Permalink
  9. object $foldLeft

    Permalink
  10. object $geoNear

    Permalink
  11. object $group

    Permalink
  12. object $limit

    Permalink
  13. object $lookup

    Permalink
  14. object $map

    Permalink
  15. object $match

    Permalink
  16. object $out

    Permalink
  17. object $project

    Permalink
  18. object $pure

    Permalink
  19. object $read

    Permalink
  20. object $redact

    Permalink
  21. object $reduce

    Permalink
  22. object $sample

    Permalink
  23. object $simpleMap

    Permalink
  24. object $skip

    Permalink
  25. object $sort

    Permalink
  26. object $unwind

    Permalink
  27. object CardinalExpr

    Permalink
  28. object Classify extends Serializable

    Permalink
  29. object Coalesce extends Serializable

    Permalink
  30. object Crush extends Serializable

    Permalink
  31. object Crystallize extends Serializable

    Permalink
  32. object Crystallized extends Serializable

    Permalink
  33. object ExcludeId extends IdHandling with Product with Serializable

    Permalink
  34. val ExprLabel: String

    Permalink
  35. val ExprName: Name

    Permalink
  36. val ExprVar: DocVar

    Permalink
  37. object IdHandling

    Permalink
  38. val IdLabel: String

    Permalink
  39. val IdName: Name

    Permalink
  40. val IdVar: DocVar

    Permalink
  41. object IgnoreId extends IdHandling with Product with Serializable

    Permalink
  42. object IncludeId extends IdHandling with Product with Serializable

    Permalink
  43. object IsPipeline

    Permalink
  44. object IsShapePreserving

    Permalink
  45. object IsSingleSource

    Permalink
  46. object IsSource

    Permalink
  47. object PipelineOp extends Serializable

    Permalink
  48. object PipelineOpCore

    Permalink
  49. object Refs extends Serializable

    Permalink
  50. object WorkflowOp3_2F

    Permalink
  51. object WorkflowOpCoreF extends Serializable

    Permalink
  52. def chain[A](src: A, op1: (A) ⇒ A, ops: (A) ⇒ A*): A

    Permalink

    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)
  53. def coalesceAll[F[_]](implicit arg0: Functor[F], I: :<:[WorkflowOpCoreF, F]): Coalesce[F]

    Permalink
  54. 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]

    Permalink
  55. def prefixBase(base: DocVar): slamdata.Predef.PartialFunction[DocVar, DocVar]

    Permalink
  56. def simpleShape[F[_]](op: Fix[F])(implicit I: :<:[F, Workflow3_2F]): slamdata.Predef.Option[slamdata.Predef.List[Name]]

    Permalink
  57. def task[F[_]](fop: Crystallized[F])(implicit arg0: Functor[F], C: Crush[F]): WorkflowTask

    Permalink
  58. def toPipelineOp[F[_], A](op: PipelineF[F, A], base: DocVar)(implicit arg0: Functor[F], I: :<:[F, WorkflowF]): PipelineOp

    Permalink
  59. implicit def workflowFCrush(implicit I: :<:[WorkflowOpCoreF, WorkflowF]): Crush[WorkflowF]

    Permalink
  60. 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]]

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped