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

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

                Author: ASF GitHub Bot
            Created on: 22/Sep/20 22:42
            Start Date: 22/Sep/20 22:42
    Worklog Time Spent: 10m 
      Work Description: rohdesamuel commented on a change in pull request 
#12800:
URL: https://github.com/apache/beam/pull/12800#discussion_r493073961



##########
File path: 
sdks/python/apache_beam/runners/interactive/interactive_environment.py
##########
@@ -348,6 +352,48 @@ def evict_cache_manager(self, pipeline=None):
       return self._cache_managers.pop(str(id(pipeline)), None)
     self._cache_managers.clear()
 
+  def set_recording_manager(self, recording_manager, pipeline):
+    """Sets the recording manager for the given pipeline."""
+    if self.get_recording_manager(pipeline) is recording_manager:
+      # NOOP if setting to the same recording_manager.
+      return
+    self._recording_managers[str(id(pipeline))] = recording_manager
+
+  def get_recording_manager(self, pipeline, create_if_absent=False):
+    """Gets the recording manager for the given pipeline."""
+    recording_manager = self._recording_managers.get(str(id(pipeline)), None)
+    if not recording_manager and create_if_absent:
+      recording_manager = RecordingManager(pipeline)
+      self._recording_managers[str(id(pipeline))] = recording_manager
+    return recording_manager
+
+  def evict_recording_manager(self, pipeline):
+    """Evicts the recording manager for the given pipeline.
+
+    This stops the background caching job and clears the cache.
+    Noop if the pipeline is absent from the environment. If no
+    pipeline is specified, evicts for all pipelines.
+    """
+    if not pipeline:
+      for rm in self._recording_managers.values():
+        rm.cancel()
+        rm.clear()
+      self._recording_managers = {}
+      return
+
+    recording_manager = self.get_recording_manager(pipeline)

Review comment:
       Added a del




----------------------------------------------------------------
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: 488640)
    Time Spent: 40h 50m  (was: 40h 40m)

> Large Source Recording for Interarctive Runner
> ----------------------------------------------
>
>                 Key: BEAM-10603
>                 URL: https://issues.apache.org/jira/browse/BEAM-10603
>             Project: Beam
>          Issue Type: Improvement
>          Components: runner-py-interactive
>            Reporter: Sam Rohde
>            Assignee: Sam Rohde
>            Priority: P1
>          Time Spent: 40h 50m
>  Remaining Estimate: 0h
>
> This changes the Interactive Runner to create a long-running background 
> caching job that is decoupled from the user pipeline. When a user invokes a 
> collect() or show(), it will read from the cache to compute the requested 
> PCollections. Previously, the user would have to wait for the cache to be 
> fully written to. This allows for the user to start experimenting immediately.



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

Reply via email to