Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

APEXMALHAR-2234 FilterOperator documentation #409

Merged
merged 1 commit into from Oct 10, 2016

Conversation

yogidevendra
Copy link
Contributor

No description provided.

@yogidevendra
Copy link
Contributor Author

@chinmaykolhatkar Could you please review this?

Copy link
Contributor

@chinmaykolhatkar chinmaykolhatkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please take care of comments and squash and rebase with master?


## 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 shall emit the filtered POJO on one output port and the rest on another output port.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you reword it as follows:
"...it emits filtered tuples on one output port and rest on another output port"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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 shall emit the filtered POJO on one output port and the rest on another output port.

Filter operator supports quasi Java expressions to specify filter rule.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might not be for this review. But we need a documentation on quasi-Java expressions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APEXMALHAR-2266 created for this

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 filter the records based on segment.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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***
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to make this a link to : https://github.com/apache/apex-malhar/tree/master/library

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

| **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 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

List there is a space between < & S

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done



### Ports
| **Port** | **Description** | **Type** | **Mandatory** |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of "Mandatory", can we make the tuple as "Connection Required"?

| **Port** | **Description** | **Type** | **Mandatory** |
| -------- | ----------- | ---- | ------------------ |
| *input* | Tuple which needs to be filtered are received on this port | Object (POJO) | Yes |
| *truePort* | Tuples which satisfies `condition` are emitted on this port | Object (POJO) | No |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link condition to "props"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

| -------- | ----------- | ---- | ------------------ |
| *input* | Tuple which needs to be filtered are received on this port | Object (POJO) | Yes |
| *truePort* | Tuples which satisfies `condition` are emitted on this port | Object (POJO) | No |
| *falsePort* | Tuples which does not satisfy `condition` are emitted on this port | Object (POJO) | No |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link "condition" to props.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@chinmaykolhatkar
Copy link
Contributor

Please add link to mkdocs.yml for the link to this document to appear in navigation.

@yogidevendra
Copy link
Contributor Author

@chinmaykolhatkar Incorporated review comments.

Copy link
Contributor

@chinmaykolhatkar chinmaykolhatkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes looks good.

@chinmaykolhatkar
Copy link
Contributor

@yogidevendra Please rebase with master. I'll merge it then.

@chinmaykolhatkar
Copy link
Contributor

Travis CI is passing but Jenkins build is failing. I would like to merge this PR as the change are only related to docs folder. This change does not impact CI builds.
Though, I'll wait for one more day to merge for anyone has any objection to it. If no objection, I'll merge the PR tomorrow morning India time.

FilterOperator documentation``
@yogidevendra yogidevendra reopened this Oct 5, 2016
@yogidevendra yogidevendra reopened this Oct 7, 2016
@asfgit asfgit merged commit 5aa6250 into apache:master Oct 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants