nwangtw commented on a change in pull request #3099: Nwang/add streamlet
operator interfaces with grouping v2
URL: https://github.com/apache/incubator-heron/pull/3099#discussion_r232722206
##########
File path: heron/api/src/java/org/apache/heron/streamlet/Streamlet.java
##########
@@ -209,6 +209,15 @@
*/
<T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator);
+ /**
+ * Returns a new Streamlet by applying the operator on each element of this
streamlet.
+ * @param operator The operator to be applied
+ * @param grouper The grouper to be applied with the operator
+ * @param <T> The return type of the transform
+ * @return Streamlet containing the output of the operation
+ */
+ <T> Streamlet<T> applyOperator(IStreamletOperator<R, T> operator,
StreamGrouper grouper);
Review comment:
That is a good question. Some other operators might need it as well.
As @jerrypeng said before, the grouping strategy for most (even though I am
not sure about its most or some) operations are fixed, like .map doesn't need
grouping in general, reduce needs a field grouping or custom grouping. Having a
streamlet level setGrouper() could be convenient but it makes it less
straightforward and cause confusion (which is why I am hesitate about the
Builder API).
I am totally open to feedbacks and other options. Please feel free to
discuss.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services