robertwb commented on a change in pull request #11005: [BEAM-8335] Modify the
StreamingCache to subclass the CacheManager
URL: https://github.com/apache/beam/pull/11005#discussion_r389209005
##########
File path: sdks/python/apache_beam/runners/direct/transform_evaluator.py
##########
@@ -214,11 +214,31 @@ class _TestStreamRootBundleProvider(RootBundleProvider):
"""
def get_root_bundles(self):
test_stream = self._applied_ptransform.transform
+
+ # The TestStream specification allows for multiple TestStreams in the same
+ # pipeline (with only one controlling the clock). Here, we use an array in
+ # the global EvaluationContext state to keep track of the iterator for each
+ # event stream.
+ idx = len(self._evaluation_context._test_stream_events)
+
+ # If there was an endpoint defined then get the events from the
+ # TestStreamService.
+ if self._evaluation_context._test_stream_endpoint:
Review comment:
I'm not convinced that storing it on the global context is an improvement on
keeping it on the bundle that gets passed back to the (new)
_TestStreamEvaluator instance. It seems harder to track who owns/accesses it
(and also that it only gets written to once). I agree the original way of doing
things may not have been ideal either.
----------------------------------------------------------------
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]
With regards,
Apache Git Services