public class RowTimeDeduplicateFunction
extends org.apache.flink.streaming.api.functions.KeyedProcessFunction<K,IN,OUT>
| Modifier and Type | Field and Description |
|---|---|
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 |
| Constructor and Description |
|---|
RowTimeDeduplicateFunction(InternalTypeInfo<org.apache.flink.table.data.RowData> typeInfo,
long minRetentionTime,
int rowtimeIndex,
boolean generateUpdateBefore,
boolean generateInsert,
boolean keepLastRow) |
| Modifier and Type | Method and Description |
|---|---|
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.api.common.functions.OpenContext openContext) |
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 in class 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–2024 The Apache Software Foundation. All rights reserved.