prateekm commented on a change in pull request #1463:
URL: https://github.com/apache/samza/pull/1463#discussion_r575474401
##########
File path: samza-api/src/main/java/org/apache/samza/operators/MessageStream.java
##########
@@ -130,11 +183,19 @@
* Note: The message will be written but not flushed to the underlying
output system before its propagated to the
* chained operators. Messages retain the original partitioning scheme when
propogated to next operator.
*
+ * @param desc description of this send to operation
* @param outputStream the output stream to send messages to
* @return this {@link MessageStream}
*/
- MessageStream<M> sendTo(OutputStream<M> outputStream);
+ MessageStream<M> sendTo(String desc, OutputStream<M> outputStream);
+ /**
+ * Equivalent to {@code window("", window, id)}
+ * @see #window(String, Window, String)
+ */
+ default <K, WV> MessageStream<WindowPane<K, WV>> window(Window<M, K, WV>
window, String id) {
Review comment:
IIUC, windows, joins, partitionBy etc already have the "id" param which
has the same function. Do we need the new param as well?
Would also prefer calling the param "id" instead of "description" to clarify
that it should be concise, and keeping it at the last param for consistency.
##########
File path: samza-api/src/main/java/org/apache/samza/operators/MessageStream.java
##########
@@ -49,25 +49,51 @@
@InterfaceStability.Evolving
public interface MessageStream<M> {
+ /**
+ * Equivalent to {@code map("", mapFn)}.
+ * @see #map(String, MapFunction)
+ */
+ default <OM> MessageStream<OM> map(MapFunction<? super M, ? extends OM>
mapFn) {
+ return map("", mapFn);
+ }
+
/**
* Applies the provided 1:1 function to messages in this {@link
MessageStream} and returns the
* transformed {@link MessageStream}.
*
+ * @param desc description of this mapping operation
Review comment:
Since this is included in logs and metric names, let's call out that
this should be a "concise name" for the operator, not a "description". Let's
also mention why users should provide this ("... to be included in metrics and
logs.")
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]