iemejia commented on a change in pull request #13018:
URL: https://github.com/apache/beam/pull/13018#discussion_r500538346
##########
File path:
runners/spark/src/main/java/org/apache/beam/runners/spark/translation/streaming/StreamingTransformTranslator.java
##########
@@ -115,6 +119,31 @@ public String toNativeString() {
};
}
+ private static TransformEvaluator<Impulse> impulse() {
+ return new TransformEvaluator<Impulse>() {
+ @Override
+ public void evaluate(Impulse transform, EvaluationContext context) {
+ ClassTag<WindowedValue<byte[]>> classTag =
ClassTag$.MODULE$.apply(WindowedValue.class);
+ JavaRDD<WindowedValue<byte[]>> rdd =
+ context
+ .getSparkContext()
+ .parallelize(
+
Collections.singletonList(WindowedValue.valueInGlobalWindow(new byte[0])));
+ ConstantInputDStream<WindowedValue<byte[]>> inputStream =
+ new ConstantInputDStream<>(context.getStreamingContext().ssc(),
rdd.rdd(), classTag);
+ JavaDStream<WindowedValue<byte[]>> stream = new
JavaDStream<>(inputStream, classTag);
+ UnboundedDataset<byte[]> output =
+ new UnboundedDataset<>(stream,
Collections.singletonList(inputStream.id()));
+ context.putDataset(transform, output);
+ }
+
+ @Override
+ public String toNativeString() {
+ return "sparkContext.<impulse>()";
Review comment:
s/sparkContext/streamingContext just for convention. I applied this
change on merge.
----------------------------------------------------------------
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]