public class RowTimeDeduplicateFunction
extends org.apache.flink.streaming.api.functions.KeyedProcessFunction<K,IN,OUT>
| 限定符和类型 | 字段和说明 |
|---|---|
protected org.apache.flink.api.common.typeutils.TypeSerializer<OUT> |
serializer |
protected org.apache.flink.api.common.state.ValueState<T> |
state |
protected long |
stateRetentionTime |
protected org.apache.flink.api.common.typeinfo.TypeInformation<T> |
typeInfo |
| 构造器和说明 |
|---|
RowTimeDeduplicateFunction(InternalTypeInfo<org.apache.flink.table.data.RowData> typeInfo,
long minRetentionTime,
int rowtimeIndex,
boolean generateUpdateBefore,
boolean generateInsert,
boolean keepLastRow) |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
deduplicateOnRowTime(org.apache.flink.api.common.state.ValueState<org.apache.flink.table.data.RowData> state,
org.apache.flink.table.data.RowData currentRow,
org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out,
boolean generateUpdateBefore,
boolean generateInsert,
int rowtimeIndex,
boolean keepLastRow)
Processes element to deduplicate on keys with row time semantic, sends current element if it
is last or first row, retracts previous element if needed.
|
void |
open(org.apache.flink.configuration.Configuration configure) |
void |
processElement(org.apache.flink.table.data.RowData input,
org.apache.flink.streaming.api.functions.KeyedProcessFunction.Context ctx,
org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out) |
protected final org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo
protected final long stateRetentionTime
protected final org.apache.flink.api.common.typeutils.TypeSerializer<OUT> serializer
protected org.apache.flink.api.common.state.ValueState<T> state
public RowTimeDeduplicateFunction(InternalTypeInfo<org.apache.flink.table.data.RowData> typeInfo, long minRetentionTime, int rowtimeIndex, boolean generateUpdateBefore, boolean generateInsert, boolean keepLastRow)
public void processElement(org.apache.flink.table.data.RowData input,
org.apache.flink.streaming.api.functions.KeyedProcessFunction.Context ctx,
org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out)
throws Exception
processElement 在类中 org.apache.flink.streaming.api.functions.KeyedProcessFunction<org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData>Exceptionpublic static void deduplicateOnRowTime(org.apache.flink.api.common.state.ValueState<org.apache.flink.table.data.RowData> state,
org.apache.flink.table.data.RowData currentRow,
org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out,
boolean generateUpdateBefore,
boolean generateInsert,
int rowtimeIndex,
boolean keepLastRow)
throws Exception
state - state of functioncurrentRow - latest row received by deduplicate functionout - underlying collectorgenerateUpdateBefore - flag to generate UPDATE_BEFORE message or notgenerateInsert - flag to gennerate INSERT message or notrowtimeIndex - the index of rowtime fieldkeepLastRow - flag to keep last row or keep first rowExceptionCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.