xinyuiscool commented on a change in pull request #14883:
URL: https://github.com/apache/beam/pull/14883#discussion_r640959195
##########
File path:
runners/samza/src/main/java/org/apache/beam/runners/samza/translation/SamzaPublishViewTranslator.java
##########
@@ -35,18 +36,25 @@ public void translate(
SamzaPublishView<ElemT, ViewT> transform,
TransformHierarchy.Node node,
TranslationContext ctx) {
- doTranslate(transform, node, ctx);
- }
-
- private static <ElemT, ViewT> void doTranslate(
- SamzaPublishView<ElemT, ViewT> transform,
- TransformHierarchy.Node node,
- TranslationContext ctx) {
-
final PCollection<List<ElemT>> input = ctx.getInput(transform);
final MessageStream<OpMessage<Iterable<ElemT>>> inputStream =
ctx.getMessageStream(input);
@SuppressWarnings("unchecked")
final Coder<WindowedValue<Iterable<ElemT>>> elementCoder = (Coder)
SamzaCoders.of(input);
+ final String viewId = ctx.getViewId(transform.getView());
+
+ final MessageStream<OpMessage<Iterable<ElemT>>> outputStream =
+ doTranslate(
+ inputStream, elementCoder, ctx.getTransformId(), viewId,
ctx.getPipelineOptions());
+
+ ctx.registerViewStream(transform.getView(), outputStream);
+ }
+
+ static <ElemT> MessageStream<OpMessage<Iterable<ElemT>>> doTranslate(
Review comment:
This is what we chatted offline. The SamzaPublishView transform will
only be created in native java. In the portable pipeline, we don't have this
transform. Instead we need to analyze the sideinputIds from the executable
stage proto payload to reconstruct the view.
--
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]