You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apex.apache.org by ch...@apache.org on 2016/10/10 06:48:29 UTC

[1/2] apex-malhar git commit: APEXMALHAR-2234 FilterOperator documentation`

Repository: apex-malhar
Updated Branches:
  refs/heads/master 53cb1836f -> 96d216e80


APEXMALHAR-2234 FilterOperator documentation`

FilterOperator documentation``


Project: http://git-wip-us.apache.org/repos/asf/apex-malhar/repo
Commit: http://git-wip-us.apache.org/repos/asf/apex-malhar/commit/5aa6250d
Tree: http://git-wip-us.apache.org/repos/asf/apex-malhar/tree/5aa6250d
Diff: http://git-wip-us.apache.org/repos/asf/apex-malhar/diff/5aa6250d

Branch: refs/heads/master
Commit: 5aa6250d3381f2922a3ce13a93a9bbaa8864b672
Parents: 9f04db7
Author: yogidevendra <yo...@apache.org>
Authored: Wed Aug 17 15:38:50 2016 +0530
Committer: yogidevendra <yo...@apache.org>
Committed: Wed Oct 5 20:12:17 2016 +0530

----------------------------------------------------------------------
 docs/operators/filter.md | 49 +++++++++++++++++++++++++++++++++++++++++++
 mkdocs.yml               |  1 +
 2 files changed, 50 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/5aa6250d/docs/operators/filter.md
----------------------------------------------------------------------
diff --git a/docs/operators/filter.md b/docs/operators/filter.md
new file mode 100644
index 0000000..2bec2b6
--- /dev/null
+++ b/docs/operators/filter.md
@@ -0,0 +1,49 @@
+Filter
+=============
+
+## Operator Objective
+This operator receives an POJO ([Plain Old Java Object](https://en.wikipedia.org/wiki/Plain_Old_Java_Object)) as an incoming tuple
+and based on the filter condition it emits filtered tuples on one output port and rest on another output port.
+
+Filter operator supports quasi Java expressions to specify filter rule.
+
+Filter operator does not hold any state and is **idempotent**, **fault-tolerant** and **statically/dynamically partitionable**.
+
+## Operator Usecase
+1. ***Customer data*** usually contains a field customer category/segment. One wants some analysis to be done for specific customer segment. One could use this filter operator to filter the records based on segment for some analysis for specific customer segment. 
+2. ***Log data*** processing pipeline may want to filter logs from specific machine/router/switch.
+
+## Operator Information
+1. Operator location: ***[malhar-library](https://github.com/apache/apex-malhar/tree/master/library)***
+2. Available since: ***3.5.0***
+3. Operator state: ***Evolving***
+3. Java Packages:
+    * Operator: ***[com.datatorrent.lib.filter.FilterOperator](https://www.datatorrent.com/docs/apidocs/com/datatorrent/lib/filter/FilterOperator.html)***
+
+## Properties, Attributes and Ports
+### <a name="props"></a>Properties of FilterOperator
+| **Property** | **Description** | **Type** | **Mandatory** | **Default Value** |
+| -------- | ----------- | ---- | ------------------ | ------------- |
+| *condition* | condition/expression with which Filtering is done. | String | Yes | N/A |
+| *additionalExpressionFunctions* | List of import classes/method that should be made statically available to expression to use. | `List<String>`| No | Empty List |
+
+### Platform Attributes that influences operator behavior
+| **Attribute** | **Description** | **Type** | **Mandatory** |
+| -------- | ----------- | ---- | ------------------ |
+| *port.input.attr.TUPLE_CLASS* | TUPLE_CLASS attribute on input port indicates the class of POJO which incoming tuple | Class or FQCN| Yes |
+
+
+### Ports
+| **Port** | **Description** | **Type** | **Connection Required** |
+| -------- | ----------- | ---- | ------------------ |
+| *input* | Tuple which needs to be filtered are received on this port | Object (POJO) | Yes |
+| *truePort* | Tuples which satisfies [condition](#props) are emitted on this port | Object (POJO) | No |
+| *falsePort* | Tuples which does not satisfy [condition](#props) are emitted on this port | Object (POJO) | No |
+
+## Limitations
+Current `FilterOperator` has following limitation:
+
+1. [APEXMALHAR-2175](https://issues.apache.org/jira/browse/APEXMALHAR-2175) : Filter condition is not able to correctly handle java reserved words.
+
+## Example
+Example for `FilterOperator` can be found at: [https://github.com/DataTorrent/examples/tree/master/tutorials/filter](https://github.com/DataTorrent/examples/tree/master/tutorials/filter)

http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/5aa6250d/mkdocs.yml
----------------------------------------------------------------------
diff --git a/mkdocs.yml b/mkdocs.yml
index 68ce01d..8d10913 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -11,4 +11,5 @@ pages:
     - File Input: operators/fsInputOperator.md
     - File Output: operators/file_output.md
     - Enricher: operators/enricher.md
+    - Filter: operators/filter.md
     - Deduper: operators/deduper.md


[2/2] apex-malhar git commit: Merge branch 'APEXMALHAR-2234-filter-doc' of https://github.com/yogidevendra/apex-malhar

Posted by ch...@apache.org.
Merge branch 'APEXMALHAR-2234-filter-doc' of https://github.com/yogidevendra/apex-malhar


Project: http://git-wip-us.apache.org/repos/asf/apex-malhar/repo
Commit: http://git-wip-us.apache.org/repos/asf/apex-malhar/commit/96d216e8
Tree: http://git-wip-us.apache.org/repos/asf/apex-malhar/tree/96d216e8
Diff: http://git-wip-us.apache.org/repos/asf/apex-malhar/diff/96d216e8

Branch: refs/heads/master
Commit: 96d216e80b8c8ac187ac31488ab559e508a59668
Parents: 53cb183 5aa6250
Author: Chinmay Kolhatkar <ch...@datatorrent.com>
Authored: Mon Oct 10 12:17:24 2016 +0530
Committer: Chinmay Kolhatkar <ch...@datatorrent.com>
Committed: Mon Oct 10 12:17:24 2016 +0530

----------------------------------------------------------------------
 docs/operators/filter.md | 49 +++++++++++++++++++++++++++++++++++++++++++
 mkdocs.yml               |  1 +
 2 files changed, 50 insertions(+)
----------------------------------------------------------------------