You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by da...@apache.org on 2022/10/20 20:19:50 UTC

[beam] branch users/damccorm/periodicImpulseDrain created (now 86ff7d3d1a4)

This is an automated email from the ASF dual-hosted git repository.

damccorm pushed a change to branch users/damccorm/periodicImpulseDrain
in repository https://gitbox.apache.org/repos/asf/beam.git


      at 86ff7d3d1a4 Immediately truncate full restriction on drain of periodic impulse

This branch includes the following new commits:

     new 86ff7d3d1a4 Immediately truncate full restriction on drain of periodic impulse

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[beam] 01/01: Immediately truncate full restriction on drain of periodic impulse

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

damccorm pushed a commit to branch users/damccorm/periodicImpulseDrain
in repository https://gitbox.apache.org/repos/asf/beam.git

commit 86ff7d3d1a4d469ee604ef7e6e8b2239bc936e1e
Author: Danny McCormick <da...@google.com>
AuthorDate: Thu Oct 20 16:19:43 2022 -0400

    Immediately truncate full restriction on drain of periodic impulse
---
 sdks/python/apache_beam/transforms/periodicsequence.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sdks/python/apache_beam/transforms/periodicsequence.py b/sdks/python/apache_beam/transforms/periodicsequence.py
index 56075a5acc7..4f8f41e1fbe 100644
--- a/sdks/python/apache_beam/transforms/periodicsequence.py
+++ b/sdks/python/apache_beam/transforms/periodicsequence.py
@@ -49,6 +49,10 @@ class ImpulseSeqGenRestrictionProvider(core.RestrictionProvider):
 
   def restriction_size(self, unused_element, restriction):
     return restriction.size()
+  
+  # On drain, immediately stop emitting new elements
+  def truncate(self, unused_element, unused_restriction):
+    return None
 
 
 class ImpulseSeqGenDoFn(beam.DoFn):