Skip to content

Commit

Permalink
Info model update.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Drogalis committed Feb 22, 2015
1 parent d635817 commit 4480583
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
14 changes: 14 additions & 0 deletions doc/user-guide/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ We'll take a quick overview of some terms you'll see in the rest of this user gu
- [Task](#task)
- [Workflow](#workflow)
- [Catalog](#catalog)
- [Flow Conditions](#flow-conditions)
- [Segment](#segment)
- [Function](#function)
- [Plugin](#plugin)
Expand Down Expand Up @@ -142,6 +143,19 @@ Example:
:onyx/doc "A HornetQ output stream"}]
```

#### Flow Conditions

In contrast to a workflow, flow conditions specify on a segment-by-segment basis which direction data should flow determined by predicate functions. This is helpful for conditionally processing a segment based off of its content.

Example:

```clojure
[{:flow/from :input-stream
:flow/to [:process-adults]
:flow/predicate :my.ns/adult?
:flow/doc "Emits segment if this segment is an adult."}
```

#### Segment

A segment is the unit of data in Onyx, and it's represented by a Clojure map. Segments represent the data flowing through the cluster.
Expand Down
8 changes: 4 additions & 4 deletions doc/user-guide/flow-conditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Workflows specify the structure of your computation as a directed, acyclic graph
The easiest way to learn how to use flow conditions is to see an example. Suppose we have the following workflow snippet:

```clojure
[[:input-stream :children]
[:input-stream :adults]
[:input-stream :western-females]
[:input-stream :everyone]
[[:input-stream :process-children]
[:input-stream :process-adults]
[:input-stream :process-western-females]
[:input-stream :process-everyone]
...]
```

Expand Down
17 changes: 16 additions & 1 deletion doc/user-guide/information-model.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Information Model

This chapter specifies what a valid catalog and workflow look like, as well as how the underlying ZooKeeper representation is realized.
This section specifies what a valid catalog, workflow, and flow conditions look like.

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
Expand All @@ -13,6 +13,7 @@ This chapter specifies what a valid catalog and workflow look like, as well as h
- [Maps with `:onyx/type` set to `:input` or `:output` must have these keys](#maps-with-onyxtype-set-to-input-or-output-must-have-these-keys)
- [Maps with `:onyx/type` set to `:function` must have these keys](#maps-with-onyxtype-set-to-function-must-have-these-keys)
- [Maps with `:onyx/type` set to `:function` may optionally have these keys](#maps-with-onyxtype-set-to-function-may-optionally-have-these-keys)
- [Flow Conditions](#flow-conditions)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand Down Expand Up @@ -65,3 +66,17 @@ This chapter specifies what a valid catalog and workflow look like, as well as h
|`:onyx/group-by-key`| `keyword` | `any`
|`:onyx/group-by-fn` | `keyword` | `any`


### Flow Conditions

- a single Clojure vector which is EDN serializable/deserializable
- all elements in the vector must be Clojure maps

| key name |type | optional?| default
|----------------------|------------------------------|----------|--------
|`:flow/from` |`keyword` | no |
|`:flow/to` |`:all`, `:none` or `[keyword]`| no |
|`:flow/predicate` |`keyword` or `[keyword]` | no |
|`:flow/exclude-keys` |`[keyword]` | yes | `[]`
|`:flow/short-circuit?`|`boolean` | yes |`false`

0 comments on commit 4480583

Please sign in to comment.