public abstract class AbstractTopNFunction extends KeyedProcessFunctionWithCleanupState<BaseRow,BaseRow,BaseRow>
| Modifier and Type | Field and Description |
|---|---|
protected long |
hitCount |
protected BaseRowTypeInfo |
inputRowType |
protected org.apache.flink.streaming.api.operators.KeyContext |
keyContext |
protected boolean |
outputRankNumber |
protected long |
rankEnd |
protected long |
requestCount |
protected Comparator<BaseRow> |
sortKeyComparator |
protected org.apache.flink.api.java.functions.KeySelector<BaseRow,BaseRow> |
sortKeySelector |
stateCleaningEnabled| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkSortKeyInBufferRange(BaseRow sortKey,
org.apache.flink.table.runtime.operators.rank.TopNBuffer buffer)
Checks whether the record should be put into the buffer.
|
protected void |
collect(org.apache.flink.util.Collector<BaseRow> out,
BaseRow inputRow) |
protected void |
collect(org.apache.flink.util.Collector<BaseRow> out,
BaseRow inputRow,
long rank) |
protected void |
delete(org.apache.flink.util.Collector<BaseRow> out,
BaseRow inputRow)
This is similar to [[retract()]] but always send retraction message regardless of generateRetraction is true or
not.
|
protected void |
delete(org.apache.flink.util.Collector<BaseRow> out,
BaseRow inputRow,
long rank)
This is with-row-number version of above delete() method.
|
protected long |
getDefaultTopNSize()
Gets default topN size.
|
protected boolean |
hasOffset() |
protected long |
initRankEnd(BaseRow row)
Initialize rank end.
|
protected boolean |
isInRankEnd(long rank) |
protected boolean |
isInRankRange(long rank) |
void |
open(org.apache.flink.configuration.Configuration parameters) |
protected void |
registerMetric(long heapSize) |
protected void |
retract(org.apache.flink.util.Collector<BaseRow> out,
BaseRow inputRow,
long rank) |
void |
setKeyContext(org.apache.flink.streaming.api.operators.KeyContext keyContext)
Sets keyContext to RankFunction.
|
cleanupState, initCleanupTimeState, isProcessingTimeTimer, needToCleanupState, registerProcessingCleanupTimeronTimer, processElementclose, getIterationRuntimeContext, getRuntimeContext, setRuntimeContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitregisterProcessingCleanupTimerprotected Comparator<BaseRow> sortKeyComparator
protected final boolean outputRankNumber
protected final BaseRowTypeInfo inputRowType
protected final org.apache.flink.api.java.functions.KeySelector<BaseRow,BaseRow> sortKeySelector
protected org.apache.flink.streaming.api.operators.KeyContext keyContext
protected long rankEnd
protected long hitCount
protected long requestCount
public void open(org.apache.flink.configuration.Configuration parameters)
throws Exception
open in interface org.apache.flink.api.common.functions.RichFunctionopen in class org.apache.flink.api.common.functions.AbstractRichFunctionExceptionprotected long getDefaultTopNSize()
protected long initRankEnd(BaseRow row) throws Exception
row - input recordExceptionprotected boolean checkSortKeyInBufferRange(BaseRow sortKey, org.apache.flink.table.runtime.operators.rank.TopNBuffer buffer)
sortKey - sortKey to testbuffer - buffer to addprotected void registerMetric(long heapSize)
protected void delete(org.apache.flink.util.Collector<BaseRow> out, BaseRow inputRow)
protected void delete(org.apache.flink.util.Collector<BaseRow> out, BaseRow inputRow, long rank)
protected void collect(org.apache.flink.util.Collector<BaseRow> out, BaseRow inputRow, long rank)
protected void retract(org.apache.flink.util.Collector<BaseRow> out, BaseRow inputRow, long rank)
protected boolean isInRankEnd(long rank)
protected boolean isInRankRange(long rank)
protected boolean hasOffset()
public void setKeyContext(org.apache.flink.streaming.api.operators.KeyContext keyContext)
keyContext - keyContext of current function.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.