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

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

                Author: ASF GitHub Bot
            Created on: 23/Aug/21 20:46
            Start Date: 23/Aug/21 20:46
    Worklog Time Spent: 10m 
      Work Description: pabloem commented on a change in pull request #15357:
URL: https://github.com/apache/beam/pull/15357#discussion_r694296637



##########
File path: sdks/python/apache_beam/io/iobase.py
##########
@@ -1573,15 +1581,28 @@ def is_bounded(self):
     return True
 
 
+class _RestrictionCoder(coders.Coder):
+  def decode(self, value):
+    return _SDFBoundedSourceRestriction(SourceBundle(*pickler.loads(value)))
+
+  def encode(self, restriction):
+    return pickler.dumps((

Review comment:
       okay - we're currently using pickler. does that lg?

##########
File path: sdks/python/apache_beam/io/iobase.py
##########
@@ -886,12 +888,18 @@ def get_desired_chunk_size(total_size):
 
   def expand(self, pbegin):
     if isinstance(self.source, BoundedSource):
+      coders.registry.register_coder(BoundedSource, _MemoizingPickleCoder)
       display_data = self.source.display_data() or {}
       display_data['source'] = self.source.__class__
+
+      def output_source(_) -> BoundedSource:
+        assert isinstance(self.source, BoundedSource)
+        return self.source
+
       return (
           pbegin
           | Impulse()
-          | core.Map(lambda _: self.source)
+          | core.Map(output_source)

Review comment:
       done. 




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

    Worklog Id:     (was: 640836)
    Time Spent: 1.5h  (was: 1h 20m)

> SDFBoundedSourceReader behaves much slower compared with the original 
> behavior of BoundedSource
> -----------------------------------------------------------------------------------------------
>
>                 Key: BEAM-12781
>                 URL: https://issues.apache.org/jira/browse/BEAM-12781
>             Project: Beam
>          Issue Type: Bug
>          Components: io-py-common
>            Reporter: Pablo Estrada
>            Assignee: Pablo Estrada
>            Priority: P2
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>




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

Reply via email to