You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by ka...@apache.org on 2016/02/05 14:05:00 UTC
[1/2] storm git commit: [STORM-1527] Added trident api doc for peek
Repository: storm
Updated Branches:
refs/heads/asf-site d9003e495 -> 7f68ed961
[STORM-1527] Added trident api doc for peek
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/2df59c04
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/2df59c04
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/2df59c04
Branch: refs/heads/asf-site
Commit: 2df59c04836780d715272320cdf2062d884b364d
Parents: d9003e4
Author: Arun Mahadevan <ai...@hortonworks.com>
Authored: Fri Feb 5 15:27:14 2016 +0530
Committer: Arun Mahadevan <ai...@hortonworks.com>
Committed: Fri Feb 5 15:27:14 2016 +0530
----------------------------------------------------------------------
documentation/Trident-API-Overview.md | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/2df59c04/documentation/Trident-API-Overview.md
----------------------------------------------------------------------
diff --git a/documentation/Trident-API-Overview.md b/documentation/Trident-API-Overview.md
index c247ffd..bc6943d 100644
--- a/documentation/Trident-API-Overview.md
+++ b/documentation/Trident-API-Overview.md
@@ -139,6 +139,22 @@ Of course these operations can be chained, so a stream of uppercase words can be
```java
mystream.flatMap(new Split()).map(new UpperCase())
```
+### peek
+`peek` can be used to perform an additional action on each trident tuple as they flow through the stream.
+ This could be useful for debugging to see the tuples as they flow past a certain point in a pipeline.
+
+For example, the below code would print the result of converting the words to uppercase before they are passed to `groupBy`
+```java
+ mystream.flatMap(new Split()).map(new UpperCase())
+ .peek(new Consumer() {
+ @Override
+ public void accept(TridentTuple input) {
+ System.out.println(input.getString(0));
+ }
+ })
+ .groupBy(new Fields("word"))
+ .persistentAggregate(new MemoryMapState.Factory(), new Count(), new Fields("count"))
+ ```
### partitionAggregate
[2/2] storm git commit: Merge branch 'peek-doc' of
https://github.com/arunmahadevan/storm into STORM-1527-asf-site
Posted by ka...@apache.org.
Merge branch 'peek-doc' of https://github.com/arunmahadevan/storm into STORM-1527-asf-site
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/7f68ed96
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/7f68ed96
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/7f68ed96
Branch: refs/heads/asf-site
Commit: 7f68ed961ac295c9f36bf4f0f28086a96cf16e50
Parents: d9003e4 2df59c0
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Fri Feb 5 22:04:35 2016 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Fri Feb 5 22:04:35 2016 +0900
----------------------------------------------------------------------
documentation/Trident-API-Overview.md | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
----------------------------------------------------------------------