public class TopNBuffer extends Object implements Serializable
| Constructor and Description |
|---|
TopNBuffer(Comparator<org.apache.flink.table.data.RowData> sortKeyComparator,
Supplier<Collection<org.apache.flink.table.data.RowData>> valueSupplier) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkSortKeyInBufferRange(org.apache.flink.table.data.RowData sortKey,
long topNum)
Checks whether the record should be put into the buffer.
|
boolean |
containsKey(org.apache.flink.table.data.RowData key)
Returns
true if the buffer contains a mapping for the specified key. |
Set<Map.Entry<org.apache.flink.table.data.RowData,Collection<org.apache.flink.table.data.RowData>>> |
entrySet()
Returns a
Set view of the mappings contained in the buffer. |
Collection<org.apache.flink.table.data.RowData> |
get(org.apache.flink.table.data.RowData sortKey)
Gets the record list from the buffer under the sortKey.
|
int |
getCurrentTopNum()
Gets number of total records.
|
org.apache.flink.table.data.RowData |
getElement(int rank)
Gets record which rank is given value.
|
Comparator<org.apache.flink.table.data.RowData> |
getSortKeyComparator()
Gets sort key comparator used by buffer.
|
org.apache.flink.table.data.RowData |
lastElement()
Returns the last record of the last Entry in the buffer.
|
Map.Entry<org.apache.flink.table.data.RowData,Collection<org.apache.flink.table.data.RowData>> |
lastEntry()
Returns the last Entry in the buffer.
|
int |
put(org.apache.flink.table.data.RowData sortKey,
org.apache.flink.table.data.RowData value)
Appends a record into the buffer.
|
void |
putAll(org.apache.flink.table.data.RowData sortKey,
Collection<org.apache.flink.table.data.RowData> values)
Puts a record list into the buffer under the sortKey.
|
void |
remove(org.apache.flink.table.data.RowData sortKey,
org.apache.flink.table.data.RowData value) |
void |
removeAll(org.apache.flink.table.data.RowData sortKey)
Removes all record list from the buffer under the sortKey.
|
org.apache.flink.table.data.RowData |
removeLast()
Removes the last record of the last Entry in the buffer.
|
public TopNBuffer(Comparator<org.apache.flink.table.data.RowData> sortKeyComparator, Supplier<Collection<org.apache.flink.table.data.RowData>> valueSupplier)
public int put(org.apache.flink.table.data.RowData sortKey,
org.apache.flink.table.data.RowData value)
sortKey - sort key with which the specified value is to be associatedvalue - record which is to be appendedpublic void putAll(org.apache.flink.table.data.RowData sortKey,
Collection<org.apache.flink.table.data.RowData> values)
sortKey - sort key with which the specified values are to be associatedvalues - record lists to be associated with the specified keypublic Collection<org.apache.flink.table.data.RowData> get(org.apache.flink.table.data.RowData sortKey)
sortKey - key to getpublic void remove(org.apache.flink.table.data.RowData sortKey,
org.apache.flink.table.data.RowData value)
public void removeAll(org.apache.flink.table.data.RowData sortKey)
sortKey - key to removepublic org.apache.flink.table.data.RowData removeLast()
public org.apache.flink.table.data.RowData lastElement()
public org.apache.flink.table.data.RowData getElement(int rank)
rank - rank value to searchpublic Set<Map.Entry<org.apache.flink.table.data.RowData,Collection<org.apache.flink.table.data.RowData>>> entrySet()
Set view of the mappings contained in the buffer.public Map.Entry<org.apache.flink.table.data.RowData,Collection<org.apache.flink.table.data.RowData>> lastEntry()
public boolean containsKey(org.apache.flink.table.data.RowData key)
true if the buffer contains a mapping for the specified key.key - key whose presence in the buffer is to be testedtrue if the buffer contains a mapping for the specified keypublic int getCurrentTopNum()
public Comparator<org.apache.flink.table.data.RowData> getSortKeyComparator()
public boolean checkSortKeyInBufferRange(org.apache.flink.table.data.RowData sortKey,
long topNum)
sortKey - sortKey to testtopNum - buffer to addCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.