Sanil15 commented on a change in pull request #984: Samza 2116: Making 
sendTo(table), sendTo(stream) non-terminal
URL: https://github.com/apache/samza/pull/984#discussion_r272272292
 
 

 ##########
 File path: 
samza-core/src/main/java/org/apache/samza/operators/MessageStreamImpl.java
 ##########
 @@ -113,18 +113,20 @@ public MessageStreamImpl(StreamApplicationDescriptorImpl 
streamAppDesc, Operator
   }
 
   @Override
-  public void sink(SinkFunction<? super M> sinkFn) {
+  public MessageStream<M> sink(SinkFunction<? super M> sinkFn) {
     String opId = this.streamAppDesc.getNextOpId(OpCode.SINK);
     SinkOperatorSpec<M> op = OperatorSpecs.createSinkOperatorSpec(sinkFn, 
opId);
     this.operatorSpec.registerNextOperatorSpec(op);
+    return new MessageStreamImpl<>(this.streamAppDesc, op);
   }
 
   @Override
-  public void sendTo(OutputStream<M> outputStream) {
+  public MessageStream<M> sendTo(OutputStream<M> outputStream) {
     String opId = this.streamAppDesc.getNextOpId(OpCode.SEND_TO);
     OutputOperatorSpec<M> op = OperatorSpecs.createSendToOperatorSpec(
         (OutputStreamImpl<M>) outputStream, opId);
     this.operatorSpec.registerNextOperatorSpec(op);
+    return new MessageStreamImpl<>(this.streamAppDesc, op);
 
 Review comment:
   Each MessageStreamImpl is associated with a single OperatorSpec in the DAG 
and allows
   users to chain operators on it, each operator runs after the previous one 
and not in parallel

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to