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

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

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

 ##########
 File path: sdks/python/apache_beam/runners/common.py
 ##########
 @@ -771,22 +810,33 @@ def try_split(self, fraction):
       # Temporary workaround for [BEAM-7473]: get current_watermark before
       # split, in case watermark gets advanced before getting split results.
       # In worst case, current_watermark is always stale, which is ok.
-      if self.watermark_estimator:
-        current_watermark = self.watermark_estimator.current_watermark()
-      else:
-        current_watermark = None
+      current_watermark = None
       split = restriction_tracker.try_split(fraction)
       if split:
         primary, residual = split
         element = self.current_windowed_value.value
         restriction_provider = self.signature.get_restriction_provider()
         primary_size = restriction_provider.restriction_size(element, primary)
         residual_size = restriction_provider.restriction_size(element, 
residual)
-        return (
-            ((self.current_windowed_value.with_value((
-                (element, primary), primary_size)), None), None),
-            ((self.current_windowed_value.with_value((
-                (element, residual), residual_size)), current_watermark), 
None))
+        if self.threadsafe_watermark_estimator:
+          current_watermark = (
+              self.threadsafe_watermark_estimator.current_watermark())
+          estimator_state = (
+              self.threadsafe_watermark_estimator.current_estimator_state())
+          return (
+              ((self.current_windowed_value.with_value((
+                  (element, (primary, None)), primary_size)), None), None),
 
 Review comment:
   I think it's fine to re-create it rather than store it--no use caching away 
the original estimator state right after we create it just to put it here. 
 
----------------------------------------------------------------
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]


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

    Worklog Id:     (was: 379608)
    Time Spent: 7h  (was: 6h 50m)

> 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: 7h
>  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