[
https://issues.apache.org/jira/browse/BEAM-10603?focusedWorklogId=478126&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-478126
]
ASF GitHub Bot logged work on BEAM-10603:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 02/Sep/20 20:48
Start Date: 02/Sep/20 20:48
Worklog Time Spent: 10m
Work Description: rohdesamuel commented on a change in pull request
#12703:
URL: https://github.com/apache/beam/pull/12703#discussion_r482445684
##########
File path: sdks/python/apache_beam/runners/interactive/recording_manager.py
##########
@@ -258,16 +278,46 @@ def _watch(self, pcolls):
ie.current_env().watch(
{'anonymous_pcollection_{}'.format(id(pcoll)): pcoll})
- def clear(self, pcolls):
+ def _clear(self, pipeline_instrument):
# type: (List[beam.pvalue.PCollection]) -> None
- """Clears the cache of the given PCollections."""
+ """Clears the recording of all non-source PCollections."""
cache_manager = ie.current_env().get_cache_manager(self.user_pipeline)
- for pc in pcolls:
- cache_key = self._pipeline_instrument.cache_key(pc)
+
+ # Only clear the PCollections that aren't being populated from the
+ # BackgroundCachingJob.
+ all_cached = set(
+ str(c.to_key()) for c in pipeline_instrument.cacheables.values())
+ source_pcolls = getattr(cache_manager, 'capture_keys', set())
+ to_clear = all_cached - source_pcolls
+
+ for cache_key in to_clear:
cache_manager.clear('full', cache_key)
+ def cancel(self):
+ # type: (None) -> None
+
+ """Cancels the current background recording job."""
+
+ bcj = ie.current_env().get_background_caching_job(self.user_pipeline)
+ if bcj:
+ bcj.cancel()
Review comment:
Great, thanks!
----------------------------------------------------------------
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: 478126)
Time Spent: 20h 50m (was: 20h 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: 20h 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)