Class BufferBundle<T>
java.lang.Object
org.apache.flink.table.runtime.operators.join.stream.bundle.BufferBundle<T>
- Direct Known Subclasses:
InputSideHasNoUniqueKeyBundle,InputSideHasUniqueKeyBundle,JoinKeyContainsUniqueKeyBundle
A
BufferBundle is a bundle to buffer the input records in memory and fold data based on
specified pattern to reduce state access. The bundle is used in MiniBatchStreamingJoinOperator.
The structure of the bundle varies depending on the JoinInputSideSpec.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract intaddRecord(org.apache.flink.table.data.RowData joinKey, org.apache.flink.table.data.RowData uniqueKey, org.apache.flink.table.data.RowData record) Adds a record into the bufferBundle when processing element in a stream and this function would return the size of the bufferBundle.voidclear()Clear this bufferBundle.Set<org.apache.flink.table.data.RowData>Get the joinKeys in bufferBundle.Get records associated with joinKeys from bufferBundle.getRecordsWithJoinKey(org.apache.flink.table.data.RowData joinKey) Get records associated with joinKeys from bufferBundle.booleanisEmpty()Check if this bufferBundle is empty.intReturn the number of reduced records.
-
Field Details
-
bundle
-
count
protected int count -
actualSize
protected int actualSize
-
-
Constructor Details
-
BufferBundle
public BufferBundle()
-
-
Method Details
-
isEmpty
public boolean isEmpty()Check if this bufferBundle is empty. -
reducedSize
public int reducedSize()Return the number of reduced records. -
clear
public void clear()Clear this bufferBundle. -
getJoinKeys
Get the joinKeys in bufferBundle. Whether to override this method is based on the implementing class. -
addRecord
public abstract int addRecord(org.apache.flink.table.data.RowData joinKey, @Nullable org.apache.flink.table.data.RowData uniqueKey, org.apache.flink.table.data.RowData record) Adds a record into the bufferBundle when processing element in a stream and this function would return the size of the bufferBundle.- Parameters:
joinKey- the joinKey associated with the record.uniqueKey- the uniqueKey associated with the record. This could be null.record- The record to add.- Returns:
- number of processed by current bundle.
-
getRecords
public abstract Map<org.apache.flink.table.data.RowData,List<org.apache.flink.table.data.RowData>> getRecords() throws ExceptionGet records associated with joinKeys from bufferBundle.- Returns:
- a map whose key is joinKey and value is list of records.
- Throws:
Exception
-
getRecordsWithJoinKey
public abstract Map<org.apache.flink.table.data.RowData,List<org.apache.flink.table.data.RowData>> getRecordsWithJoinKey(org.apache.flink.table.data.RowData joinKey) throws Exception Get records associated with joinKeys from bufferBundle. And this function is different from getRecords() above where getRecords() returns a map whose key is joinKey and value is list of records.- Parameters:
joinKey- one of joinKeys stored in this bundle.- Returns:
- a map whose key is uniqueKey and value is a list of records.
- Throws:
Exception
-