public abstract class BufferBundle<T> extends Object
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
.Modifier and Type | Field and Description |
---|---|
protected int |
actualSize |
protected Map<RowData,T> |
bundle |
protected int |
count |
Constructor and Description |
---|
BufferBundle() |
Modifier and Type | Method and Description |
---|---|
abstract int |
addRecord(RowData joinKey,
RowData uniqueKey,
RowData record)
Adds a record into the bufferBundle when processing element in a stream and this function
would return the size of the bufferBundle.
|
void |
clear()
Clear this bufferBundle.
|
Set<RowData> |
getJoinKeys()
Get the joinKeys in bufferBundle.
|
abstract Map<RowData,List<RowData>> |
getRecords()
Get records associated with joinKeys from bufferBundle.
|
abstract Map<RowData,List<RowData>> |
getRecordsWithJoinKey(RowData joinKey)
Get records associated with joinKeys from bufferBundle.
|
boolean |
isEmpty()
Check if this bufferBundle is empty.
|
int |
reducedSize()
Return the number of reduced records.
|
public boolean isEmpty()
public int reducedSize()
public void clear()
public Set<RowData> getJoinKeys()
public abstract int addRecord(RowData joinKey, @Nullable RowData uniqueKey, RowData record)
joinKey
- the joinKey associated with the record.uniqueKey
- the uniqueKey associated with the record. This could be null.record
- The record to add.public abstract Map<RowData,List<RowData>> getRecords() throws Exception
Exception
public abstract Map<RowData,List<RowData>> getRecordsWithJoinKey(RowData joinKey) throws Exception
joinKey
- one of joinKeys stored in this bundle.Exception
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.