本文整理汇总了Java中org.apache.flink.streaming.api.functions.co.CoProcessFunction类的典型用法代码示例。如果您正苦于以下问题:Java CoProcessFunction类的具体用法?Java CoProcessFunction怎么用?Java CoProcessFunction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CoProcessFunction类属于org.apache.flink.streaming.api.functions.co包,在下文中一共展示了CoProcessFunction类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import org.apache.flink.streaming.api.functions.co.CoProcessFunction; //导入依赖的package包/类
/**
* Applies the given {@link CoProcessFunction} on the connected input streams,
* thereby creating a transformed output stream.
*
* <p>The function will be called for every element in the input streams and can produce zero or
* more output elements. Contrary to the {@link #flatMap(CoFlatMapFunction)} function, this
* function can also query the time and set timers. When reacting to the firing of set timers
* the function can directly emit elements and/or register yet more timers.
*
* @param coProcessFunction The {@link CoProcessFunction} that is called for each element
* in the stream.
*
* @param <R> The type of elements emitted by the {@code CoProcessFunction}.
*
* @return The transformed {@link DataStream}.
*/
@PublicEvolving
public <R> SingleOutputStreamOperator<R> process(
CoProcessFunction<IN1, IN2, R> coProcessFunction) {
TypeInformation<R> outTypeInfo = TypeExtractor.getBinaryOperatorReturnType(
coProcessFunction,
CoProcessFunction.class,
0,
1,
2,
TypeExtractor.NO_INDEX,
TypeExtractor.NO_INDEX,
TypeExtractor.NO_INDEX,
getType1(),
getType2(),
Utils.getCallLocationName(),
true);
return process(coProcessFunction, outTypeInfo);
}
示例2: CoProcessOperator
import org.apache.flink.streaming.api.functions.co.CoProcessFunction; //导入依赖的package包/类
public CoProcessOperator(CoProcessFunction<IN1, IN2, OUT> flatMapper) {
super(flatMapper);
}
示例3: ContextImpl
import org.apache.flink.streaming.api.functions.co.CoProcessFunction; //导入依赖的package包/类
ContextImpl(CoProcessFunction<IN1, IN2, OUT> function, ProcessingTimeService timerService) {
function.super();
this.timerService = checkNotNull(timerService);
}
示例4: KeyedCoProcessOperator
import org.apache.flink.streaming.api.functions.co.CoProcessFunction; //导入依赖的package包/类
public KeyedCoProcessOperator(CoProcessFunction<IN1, IN2, OUT> flatMapper) {
super(flatMapper);
}
示例5: ContextImpl
import org.apache.flink.streaming.api.functions.co.CoProcessFunction; //导入依赖的package包/类
ContextImpl(CoProcessFunction<IN1, IN2, OUT> function, TimerService timerService) {
function.super();
this.timerService = checkNotNull(timerService);
}
示例6: OnTimerContextImpl
import org.apache.flink.streaming.api.functions.co.CoProcessFunction; //导入依赖的package包/类
OnTimerContextImpl(CoProcessFunction<IN1, IN2, OUT> function, TimerService timerService) {
function.super();
this.timerService = checkNotNull(timerService);
}