Search in sources :

Example 1 with PairDStreamCollection

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);
}
Also used : PairDStreamCollection(io.cdap.cdap.etl.spark.streaming.PairDStreamCollection) DynamicDriverContext(io.cdap.cdap.etl.spark.streaming.DynamicDriverContext)

Aggregations

DynamicDriverContext (io.cdap.cdap.etl.spark.streaming.DynamicDriverContext)1 PairDStreamCollection (io.cdap.cdap.etl.spark.streaming.PairDStreamCollection)1