mynameborat commented on code in PR #23313:
URL: https://github.com/apache/beam/pull/23313#discussion_r982879280
##########
runners/samza/src/main/java/org/apache/beam/runners/samza/runtime/OpAdapter.java:
##########
@@ -188,7 +176,31 @@ public void emitWatermark(Instant watermark) {
@Override
public <T> void emitView(String id, WindowedValue<Iterable<T>> elements) {
- outputList.add(OpMessage.ofSideInput(id, elements));
+ outputQueue.add(OpMessage.ofSideInput(id, elements));
+ }
+
+ @Override
+ public Collection<OpMessage<OutT>> collectOutput() {
+ final List<OpMessage<OutT>> outputList = new ArrayList<>();
+ OpMessage<OutT> output;
+ while ((output = outputQueue.poll()) != null) {
+ outputList.add(output);
+ }
+ return outputList;
+ }
+
+ @Override
+ public CompletionStage<Collection<OpMessage<OutT>>> collectFuture() {
+ final CompletionStage<Collection<OpMessage<OutT>>> future = outputFuture;
+ outputFuture = null;
Review Comment:
Sounds good.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]