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

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

                Author: ASF GitHub Bot
            Created on: 10/Jan/20 00:14
            Start Date: 10/Jan/20 00:14
    Worklog Time Spent: 10m 
      Work Description: boyuanzz commented on pull request #10375: [BEAM-8537] 
Provide WatermarkEstimator to track watermark
URL: https://github.com/apache/beam/pull/10375#discussion_r365021157
 
 

 ##########
 File path: sdks/python/apache_beam/runners/worker/bundle_processor.py
 ##########
 @@ -1243,17 +1243,28 @@ def create(factory, transform_id, transform_proto, 
serialized_fn, consumers):
 def create(*args):
 
   class PairWithRestriction(beam.DoFn):
-    def __init__(self, fn, restriction_provider):
+    def __init__(self,
+                 fn,
+                 restriction_provider,
+                 watermark_estimator_provider=None):
       self.restriction_provider = restriction_provider
-
+      self.watermark_estimator_provider = watermark_estimator_provider
     # An unused window is requested to force explosion of multi-window
     # WindowedValues.
     def process(
         self, element, _unused_window=beam.DoFn.WindowParam, *args, **kwargs):
       # TODO(SDF): Do we want to allow mutation of the element?
       # (E.g. it could be nice to shift bulky description to the portion
       # that can be distributed.)
-      yield element, self.restriction_provider.initial_restriction(element)
+      initial_restriction = self.restriction_provider.initial_restriction(
+          element)
+      if self.watermark_estimator_provider:
+        yield (element,
 
 Review comment:
   We also need to emit (initial_restriction, initial_estimator_state) here to 
make sure `get_restriction_coder` works,
 
----------------------------------------------------------------
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 369471)
    Time Spent: 20m  (was: 10m)

> Provide WatermarkEstimatorProvider for different types of WatermarkEstimator
> ----------------------------------------------------------------------------
>
>                 Key: BEAM-8537
>                 URL: https://issues.apache.org/jira/browse/BEAM-8537
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-py-core, sdk-py-harness
>            Reporter: Boyuan Zhang
>            Assignee: Boyuan Zhang
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> This is a follow up for in-progress PR:  
> https://github.com/apache/beam/pull/9794.
> Current implementation in PR9794 provides a default implementation of 
> WatermarkEstimator. For further work, we want to let WatermarkEstimator to be 
> a pure Interface. We'll provide a WatermarkEstimatorProvider to be able to 
> create a custom WatermarkEstimator per windowed value. It should be similar 
> to how we track restriction for SDF: 
> WatermarkEstimator <---> RestrictionTracker 
> WatermarkEstimatorProvider <---> RestrictionTrackerProvider
> WatermarkEstimatorParam <---> RestrictionDoFnParam



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to