use of io.cdap.cdap.etl.spark.streaming.PairDStreamCollection in project cdap by caskdata.
the class SparkStreamingPipelineRunner method addJoinKey.
@Override
protected SparkPairCollection<Object, Object> addJoinKey(StageSpec stageSpec, FunctionCache.Factory functionCacheFactory, String inputStageName, SparkCollection<Object> inputCollection, StageStatisticsCollector collector) throws Exception {
DynamicDriverContext dynamicDriverContext = new DynamicDriverContext(stageSpec, sec, collector);
JavaDStream<Object> dStream = inputCollection.getUnderlying();
JavaPairDStream<Object, Object> result = dStream.transformToPair(new DynamicJoinOn<>(dynamicDriverContext, functionCacheFactory.newCache(), inputStageName));
return new PairDStreamCollection<>(sec, functionCacheFactory, result);
}
Aggregations