[ 
https://issues.apache.org/jira/browse/BEAM-5760?focusedWorklogId=156072&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-156072
 ]

ASF GitHub Bot logged work on BEAM-5760:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 18/Oct/18 18:24
            Start Date: 18/Oct/18 18:24
    Worklog Time Spent: 10m 
      Work Description: mxm commented on a change in pull request #6723: 
[BEAM-5760] Add support for multi-element bundles to portable Flink runner.
URL: https://github.com/apache/beam/pull/6723#discussion_r226415107
 
 

 ##########
 File path: 
runners/flink/src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/ExecutableStageDoFnOperator.java
 ##########
 @@ -222,12 +189,38 @@ protected void 
addSideInputValue(StreamRecord<RawUnionValue> streamRecord) {
 
   private class SdkHarnessDoFnRunner implements DoFnRunner<InputT, OutputT> {
     @Override
-    public void startBundle() {}
+    public void startBundle() {
+      checkState(
+          stageBundleFactory != null, "%s not yet prepared", 
StageBundleFactory.class.getName());
+      checkState(
+          stateRequestHandler != null, "%s not yet prepared", 
StateRequestHandler.class.getName());
+      OutputReceiverFactory receiverFactory =
+          new OutputReceiverFactory() {
+            @Override
+            public FnDataReceiver<OutputT> create(String pCollectionId) {
+              return (receivedElement) -> {
+                // handover to queue, do not block the grpc thread
+                outputQueue.put(KV.of(pCollectionId, receivedElement));
+              };
+            }
+          };
+
+      try {
+        remoteBundle =
+            stageBundleFactory.getBundle(receiverFactory, stateRequestHandler, 
progressHandler);
+      } catch (Exception e) {
+        throw new RuntimeException("Failed to start remote bundle", e);
+      }
+    }
 
     @Override
-    public void processElement(WindowedValue<InputT> elem) {
+    public void processElement(WindowedValue<InputT> element) {
       try {
-        processElementWithSdkHarness(elem);
+        checkState(remoteBundle != null, "%s not yet prepared", 
RemoteBundle.class.getName());
+        LOG.debug(String.format("Sending value: %s", element));
+        // TODO(BEAM-4681): Add support to Flink to support portable timers.
+        
Iterables.getOnlyElement(remoteBundle.getInputReceivers().values()).accept(element);
+        emitResults();
 
 Review comment:
   Should we move this outside the try/catch?

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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 156072)
    Time Spent: 2h 50m  (was: 2h 40m)

> Portable Flink support for maxBundleSize/maxBundleMillis
> --------------------------------------------------------
>
>                 Key: BEAM-5760
>                 URL: https://issues.apache.org/jira/browse/BEAM-5760
>             Project: Beam
>          Issue Type: Improvement
>          Components: runner-flink
>    Affects Versions: 2.8.0
>            Reporter: Thomas Weise
>            Assignee: Thomas Weise
>            Priority: Major
>              Labels: portability-flink
>             Fix For: 2.9.0
>
>          Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> The portable runner needs to support larger bundles in streaming mode. 
> Currently every element is a separate bundle, which is very inefficient due 
> to the per bundle SDK worker overhead. The old Java SDK runner already 
> supports these parameters.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to