rohdesamuel 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_r389205722
##########
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:
This is a way to keep track of where in the event stream the TestStream is.
Because the _TestStreamEvaluator can be created multiple times, the iterator
will become invalid once we try to make a new one. This is actually a cleanup
of the old implementation where the state was kept in an unprocessed bundle
that was passed to itself.
----------------------------------------------------------------
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