You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by GitBox <gi...@apache.org> on 2020/03/05 18:26:58 UTC

[GitHub] [beam] KevinGG commented on a change in pull request #11050: [BEAM-8335] Implemented Capture Size limitation

KevinGG commented on a change in pull request #11050: [BEAM-8335] Implemented Capture Size limitation
URL: https://github.com/apache/beam/pull/11050#discussion_r388479176
 
 

 ##########
 File path: sdks/python/apache_beam/runners/interactive/background_caching_job.py
 ##########
 @@ -202,10 +202,20 @@ def has_source_to_cache(user_pipeline):
   if has_cache:
     if not isinstance(ie.current_env().cache_manager(),
                       streaming_cache.StreamingCache):
-      # TODO(BEAM-8335): convert the cache manager into a streaming cache
-      # manager. Note this does not invalidate the current cache including the
-      # source data capture.
-      pass
+      # Wrap the cache manager into a streaming cache manager. Note this
+      # does not invalidate the current cache manager.
+      def is_cache_complete():
+        job = ie.current_env().get_background_caching_job(user_pipeline)
+        is_done = job and job.is_done()
+        cache_changed = is_source_to_cache_changed(
+            user_pipeline, update_cached_source_signature=False)
+        return is_done and not cache_changed
+
+      ie.current_env().set_cache_manager(
+          streaming_cache.StreamingCache(
+              ie.current_env().cache_manager()._cache_dir,
+              is_cache_complete=is_cache_complete,
 
 Review comment:
   `is_cache_complete` is a function required by StreamingCache, not the return value of the function.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services