taegeonum commented on a change in pull request #159: [NEMO-216,251,259] Support side inputs and windowing URL: https://github.com/apache/incubator-nemo/pull/159#discussion_r234427604
########## File path: compiler/frontend/beam/src/main/java/org/apache/nemo/compiler/frontend/beam/PipelineTranslationContext.java ########## @@ -91,69 +93,83 @@ void addVertex(final IRVertex vertex) { builder.addVertex(vertex, loopVertexStack); } + /** + * Say the dstIRVertex consumes three views: view0, view1, and view2. + * + * We translate that as the following: + * view0 -> SideInputTransform(index=0) -> + * view1 -> SideInputTransform(index=1) -> dstIRVertex(with a map from indices to PCollectionViews) + * view2 -> SideInputTransform(index=2) -> + * + * @param dstVertex vertex. + * @param sideInputs of the vertex. + */ + void addSideInputEdges(final IRVertex dstVertex, final Map<Integer, PCollectionView<?>> sideInputs) { + for (final Map.Entry<Integer, PCollectionView<?>> entry : sideInputs.entrySet()) { + final int index = entry.getKey(); + final PCollectionView view = entry.getValue(); + + final IRVertex srcVertex = pValueToProducerVertex.get(view); + final IRVertex sideInputTransformVertex = new OperatorVertex(new SideInputTransform(index)); Review comment: Why don't you use the `view`, instead of `index`? I think using `view` is more explicit, instead of the index. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services