beam-github mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [beam] xinyuiscool commented on a change in pull request #15421: [BEAM-12823] TestStream Support in Samza Portable Runner
Date Thu, 02 Sep 2021 20:38:26 GMT

xinyuiscool commented on a change in pull request #15421:
URL: https://github.com/apache/beam/pull/15421#discussion_r701406444



##########
File path: runners/samza/src/main/java/org/apache/beam/runners/samza/translation/SamzaTestStreamTranslator.java
##########
@@ -90,11 +97,54 @@ public void translate(
     ctx.registerInputMessageStream(output, inputDescriptor);
   }
 
+  @SuppressWarnings("unchecked")
   @Override
   public void translatePortable(
       PipelineNode.PTransformNode transform,
       QueryablePipeline pipeline,
       PortableTranslationContext ctx) {
-    throw new SamzaException("TestStream is not supported in portable by Samza runner");
+    final ByteString bytes = transform.getTransform().getSpec().getPayload();
+    final Coder<T> coder;
+
+    try {
+      coder =
+          (Coder<T>)
+              RehydratedComponents.forComponents(pipeline.getComponents())
+                  .getCoder(RunnerApi.TestStreamPayload.parseFrom(bytes).getCoderId());
+    } catch (IOException e) {
+      throw new SamzaException(e);

Review comment:
       Let's throw a RuntimeException() here.




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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message