[
https://issues.apache.org/jira/browse/BEAM-10603?focusedWorklogId=480124&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-480124
]
ASF GitHub Bot logged work on BEAM-10603:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 08/Sep/20 13:23
Start Date: 08/Sep/20 13:23
Worklog Time Spent: 10m
Work Description: pabloem commented on a change in pull request #12703:
URL: https://github.com/apache/beam/pull/12703#discussion_r482544524
##########
File path: sdks/python/apache_beam/runners/interactive/recording_manager.py
##########
@@ -63,6 +63,12 @@ def var(self):
"""Returns the variable named that defined this PCollection."""
return self._var
+ def cache_key(self):
Review comment:
Generally doing this is not necessary. You can name the attribute
`self.cache_key`, and users can access the attribute directly, unless there's a
strong reason not to.
##########
File path: sdks/python/apache_beam/runners/interactive/recording_manager.py
##########
@@ -258,16 +278,44 @@ 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())
Review comment:
It's a little unsafe to use string representation as keys, no? Should
CacheKey implement a hash method instead?
##########
File path: sdks/python/apache_beam/runners/interactive/recording_manager.py
##########
@@ -258,16 +278,44 @@ 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())
Review comment:
It seems that we're using the string representation everywhere, so it
may represent a large change - and I see it;s a carefully written repr method,
so it's not necessary for this PR.
----------------------------------------------------------------
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: 480124)
Time Spent: 23h 20m (was: 23h 10m)
> 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: 23h 20m
> 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)