beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [beam] rohdesamuel commented on a change in pull request #11005: [BEAM-8335] Modify the StreamingCache to subclass the CacheManager
Date Fri, 06 Mar 2020 22:10:20 GMT
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_r389168571
 
 

 ##########
 File path: sdks/python/apache_beam/runners/direct/test_stream_impl.py
 ##########
 @@ -226,17 +237,53 @@ def expand(self, pcoll):
   def _infer_output_coder(self, input_type=None, input_coder=None):
     return self.coder
 
-  def _events_from_script(self, index):
-    yield self._events[index]
-
-  def events(self, index):
-    return self._events_from_script(index)
-
-  def begin(self):
-    return 0
-
-  def end(self, index):
-    return index >= len(self._events)
+  @staticmethod
+  def events_from_script(events):
+    """Yields the in-memory events.
+    """
+    return itertools.chain(events)
 
-  def next(self, index):
-    return index + 1
+  @staticmethod
+  def events_from_rpc(endpoint, output_tags, coder):
+    """Yields the events received from the given endpoint.
+    """
+    stub_channel = grpc.insecure_channel(endpoint)
+    stub = beam_runner_api_pb2_grpc.TestStreamServiceStub(stub_channel)
+
+    # Request the PCollections that we are looking for from the service.
+    if list(output_tags) == [None]:
 
 Review comment:
   Yes, the proto expects a string

----------------------------------------------------------------
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

Mime
View raw message