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.).
- Alphabetic
- By Inheritance
- workflow
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- final case class $AddFieldsF[A](src: A, shape: Reshape[ExprOp]) extends WorkflowOp3_4F[A] with Product with Serializable
-
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. -
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.
- 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
- final case class $GroupF[A](src: A, grouped: Grouped[ExprOp], by: Shape[ExprOp]) extends WorkflowOpCoreF[A] with Product with Serializable
- final case class $LimitF[A](src: A, count: slamdata.Predef.Long) extends WorkflowOpCoreF[A] with Product with Serializable
- final case class $LookupF[A](src: A, from: CollectionName, localField: BsonField, foreignField: BsonField, as: BsonField) extends WorkflowOpCoreF[A] with Product with Serializable
-
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. - final case class $MatchF[A](src: A, selector: Selector) extends WorkflowOpCoreF[A] with Product with Serializable
-
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.
- final case class $ProjectF[A](src: A, shape: Reshape[ExprOp], idExclusion: IdHandling) extends WorkflowOpCoreF[A] with Product with Serializable
- final case class $PureF(value: Bson) extends WorkflowOpCoreF[slamdata.Predef.Nothing] with Product with Serializable
- final case class $ReadF(coll: Collection) extends WorkflowOpCoreF[slamdata.Predef.Nothing] with Product with Serializable
- final case class $RedactF[A](src: A, value: Fix[ExprOp]) extends WorkflowOpCoreF[A] with Product with Serializable
-
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.
- final case class $SampleF[A](src: A, size: slamdata.Predef.Int) extends WorkflowOpCoreF[A] with Product with Serializable
- final case class $SimpleMapF[A](src: A, exprs: NonEmptyList[CardinalExpr[JsFn]], scope: Scope) extends MapReduceF[A] with Product with Serializable
- final case class $SkipF[A](src: A, count: slamdata.Predef.Long) extends WorkflowOpCoreF[A] with Product with Serializable
- final case class $SortF[A](src: A, value: NonEmptyList[(BsonField, SortDir)]) extends WorkflowOpCoreF[A] with Product with Serializable
- 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
- sealed abstract class CardinalExpr[A] extends AnyRef
- trait Classify[F[_]] extends Serializable
- trait Coalesce[F[_]] extends Serializable
-
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.
- trait Crystallize[F[_]] extends Serializable
-
final
case class
Crystallized[F[_]](op: Fix[F]) extends Product with Serializable
A type for a
Workflowwhich has hadcrystallizeapplied to it. - type FixOp[F[_]] = (Fix[F]) ⇒ Fix[F]
- final case class FlatExpr[A](fn: A) extends CardinalExpr[A] with Product with Serializable
- sealed abstract class IdHandling extends AnyRef
- final case class MapExpr[A](fn: A) extends CardinalExpr[A] with Product with Serializable
- sealed abstract class MapReduceF[A] extends WorkflowOpCoreF[A]
-
abstract
class
PipelineF[F[_], A] extends SingleSourceF[F, A]
Newtype for ops which can appear in aggregation pipeline.
-
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.
- trait Refs[F[_]] extends Serializable
- abstract class RewriteRefs[F[_]] extends AnyRef
-
abstract
class
ShapePreservingF[F[_], A] extends PipelineF[F, A]
Newtype for ops which preserve the shape of the input.
-
abstract
class
SingleSourceF[F[_], A] extends AnyRef
Newtype for ops which have a single source op.
-
final
case class
SourceF[F[_], A](wf: F[A]) extends Product with Serializable
Newtype for source ops (that is, ops that are themselves sources).
-
final
case class
SubExpr[A](place: A, fn: A) extends CardinalExpr[A] with Product with Serializable
Like
MapExpr, but stores the result offninplace(which must be assignable). - type Workflow = Fix[WorkflowF]
-
type
Workflow3_2F[A] = WorkflowOpCoreF[A]
The type for workflows targeting MongoDB 3.2 specifically.
-
type
Workflow3_4F[A] = Coproduct[WorkflowOp3_4F, WorkflowOpCoreF, A]
The type for workflows targeting MongoDB 3.4 specifically.
-
type
WorkflowF[A] = Coproduct[WorkflowOp3_4F, WorkflowOpCoreF, A]
The type for workflows supporting the most advanced capabilities.
-
sealed abstract
class
WorkflowOp3_4F[+A] extends slamdata.Predef.Product with slamdata.Predef.Serializable
Ops that are provided by MongoDB since 3.4.
-
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
-
val
ExprName: Name
MapReduce result expression key.
- val ExprVar: DocVar
-
val
IdName: Name
MapReduce result identity key.
- val IdVar: DocVar
-
val
QuasarSigilName: Name
Quasar result sigil.
- val QuasarSigilVar: DocVar
- val W34: Inject[WorkflowOp3_4F, WorkflowF]
- val WC: Inject[WorkflowOpCoreF, WorkflowF]
-
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)
- def coalesceAll[F[_]](implicit arg0: Functor[F], I: :<:[WorkflowOpCoreF, F]): Coalesce[F]
- 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]
- def prefixBase(base: DocVar): slamdata.Predef.PartialFunction[DocVar, DocVar]
- def simpleShape[F[_]](op: Fix[F])(implicit I: :<:[F, WorkflowF]): slamdata.Predef.Option[slamdata.Predef.List[Name]]
-
def
simpleShape32[F[_]](wf: WorkflowOpCoreF[Fix[F]])(implicit I: :<:[F, WorkflowF]): slamdata.Predef.Option[slamdata.Predef.List[Name]]
- Annotations
- @SuppressWarnings()
-
def
simpleShape34[F[_]](wf: WorkflowOp3_4F[Fix[F]])(implicit I: :<:[F, WorkflowF]): slamdata.Predef.Option[slamdata.Predef.List[Name]]
- Annotations
- @SuppressWarnings()
- def task[F[_]](fop: Crystallized[F])(implicit arg0: Functor[F], C: Crush[F]): WorkflowTask
- def toPipelineOp[F[_], A](op: PipelineF[F, A], base: DocVar)(implicit arg0: Functor[F], I: :<:[F, WorkflowF]): PipelineOp
- implicit def workflowFCrush(implicit I: :<:[WorkflowOpCoreF, WorkflowF]): Crush[WorkflowF]
- 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]]
- object $FlatMapF extends Serializable
- object $MapF extends Serializable
- object $ProjectF extends Serializable
- object $RedactF extends Serializable
- object $ReduceF extends Serializable
- object $SimpleMapF extends Serializable
- object $SortF extends Serializable
- object $addFields
- object $flatMap
- object $foldLeft
- object $geoNear
- object $group
- object $limit
- object $lookup
- object $map
- object $match
- object $out
- object $project
- object $pure
- object $read
- object $redact
- object $reduce
- object $sample
- object $simpleMap
- object $skip
- object $sort
- object $unwind
- object CardinalExpr
- object Classify extends Serializable
- object Coalesce extends Serializable
- object Crush extends Serializable
- object Crystallize extends Serializable
- object Crystallized extends Serializable
- object ExcludeId extends IdHandling with Product with Serializable
- object IdHandling
- object IgnoreId extends IdHandling with Product with Serializable
- object IncludeId extends IdHandling with Product with Serializable
- object IsPipeline
- object IsShapePreserving
- object IsSingleSource
- object IsSource
- object PipelineOp extends Serializable
- object PipelineOpCore
- object Refs extends Serializable
- object WorkflowOp3_4F extends Serializable
- object WorkflowOpCoreF extends Serializable
- object needsMapBeforeSort