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

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

                Author: ASF GitHub Bot
            Created on: 29/Jan/19 09:05
            Start Date: 29/Jan/19 09:05
    Worklog Time Spent: 10m 
      Work Description: robertwb commented on pull request #7330: [BEAM-6233]: 
Add initial user timer support in Dataflow for batch pipelines
URL: https://github.com/apache/beam/pull/7330#discussion_r251741963
 
 

 ##########
 File path: 
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/fn/control/ProcessRemoteBundleOperation.java
 ##########
 @@ -48,25 +62,119 @@
       new OutputReceiverFactory() {
         @Override
         public FnDataReceiver<?> create(String pCollectionId) {
-          return receivedElement -> {
-            LOG.debug("Consume element {}", receivedElement);
-            outputReceiverMap.get(pCollectionId).process((WindowedValue<?>) 
receivedElement);
-          };
+          return receivedElement -> receive(pCollectionId, receivedElement);
         }
       };
   private final StateRequestHandler stateRequestHandler;
   private final BundleProgressHandler progressHandler;
   private RemoteBundle remoteBundle;
+  private final DataflowExecutionContext<?> executionContext;
+  private ExecutableStage executableStage;
+
+  private final Map<String, ProcessBundleDescriptors.TimerSpec> 
timerOutputIdToSpecMap;
+  private final Map<String, Coder<BoundedWindow>> timerWindowCodersMap;
+  private final Map<String, ProcessBundleDescriptors.TimerSpec> 
timerIdToTimerSpecMap;
+  private final Map<String, Object> timerIdToKey;
+  private final Map<String, Object> timerIdToPayload;
 
   public ProcessRemoteBundleOperation(
-      OperationContext context,
+      ExecutableStage executableStage,
+      DataflowExecutionContext<?> executionContext,
+      DataflowOperationContext operationContext,
       StageBundleFactory stageBundleFactory,
       Map<String, OutputReceiver> outputReceiverMap) {
-    super(EMPTY_RECEIVER_ARRAY, context);
+    super(EMPTY_RECEIVER_ARRAY, operationContext);
+
     this.stageBundleFactory = stageBundleFactory;
-    this.outputReceiverMap = outputReceiverMap;
     this.stateRequestHandler = StateRequestHandler.unsupported();
     this.progressHandler = BundleProgressHandler.ignored();
+    this.executionContext = executionContext;
+    this.executableStage = executableStage;
+    this.outputReceiverMap = outputReceiverMap;
+
+    this.timerOutputIdToSpecMap = new HashMap<>();
+    this.timerIdToKey = new HashMap<>();
+    this.timerIdToPayload = new HashMap<>();
+    this.timerIdToTimerSpecMap = new HashMap<>();
+
+    ProcessBundleDescriptors.ExecutableProcessBundleDescriptor 
executableProcessBundleDescriptor =
+        stageBundleFactory.getProcessBundleDescriptor();
+
+    BeamFnApi.ProcessBundleDescriptor processBundleDescriptor =
+        executableProcessBundleDescriptor.getProcessBundleDescriptor();
+
+    // Create and cache lookups so that we don't have to dive into the 
ProcessBundleDescriptor
+    // later.
+    fillTimerSpecMaps(
+        executableProcessBundleDescriptor, this.timerIdToTimerSpecMap, 
this.timerOutputIdToSpecMap);
+    this.timerWindowCodersMap =
 
 Review comment:
   Consistency: either fill maps or return them.
 
----------------------------------------------------------------
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: 191545)
    Time Spent: 5h 10m  (was: 5h)

> Make bundle execution with ExecutableStage support timer/states
> ---------------------------------------------------------------
>
>                 Key: BEAM-6233
>                 URL: https://issues.apache.org/jira/browse/BEAM-6233
>             Project: Beam
>          Issue Type: Task
>          Components: runner-dataflow
>            Reporter: Boyuan Zhang
>            Assignee: Sam Rohde
>            Priority: Major
>          Time Spent: 5h 10m
>  Remaining Estimate: 0h
>




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

Reply via email to