use of co.cask.cdap.etl.spark.streaming.DynamicDriverContext in project cdap by caskdata.
the class SparkStreamingPipelineRunner method addJoinKey.
@Override
protected SparkPairCollection<Object, Object> addJoinKey(StageInfo stageInfo, String inputStageName, SparkCollection<Object> inputCollection) throws Exception {
DynamicDriverContext dynamicDriverContext = new DynamicDriverContext(stageInfo, sec);
JavaDStream<Object> dStream = inputCollection.getUnderlying();
JavaPairDStream<Object, Object> result = dStream.transformToPair(new DynamicJoinOn<>(dynamicDriverContext, inputStageName));
return new PairDStreamCollection<>(sec, result);
}
use of co.cask.cdap.etl.spark.streaming.DynamicDriverContext in project cdap by caskdata.
the class SparkStreamingPipelineRunner method mergeJoinResults.
@Override
protected SparkCollection<Object> mergeJoinResults(StageInfo stageInfo, SparkPairCollection<Object, List<JoinElement<Object>>> joinedInputs) throws Exception {
DynamicDriverContext dynamicDriverContext = new DynamicDriverContext(stageInfo, sec);
JavaPairDStream<Object, List<JoinElement<Object>>> pairDStream = joinedInputs.getUnderlying();
JavaDStream<Object> result = pairDStream.transform(new DynamicJoinMerge<>(dynamicDriverContext));
return new DStreamCollection<>(sec, result);
}
Aggregations