Class Batch<RequestEntryT extends Serializable>
- java.lang.Object
-
- org.apache.flink.connector.base.sink.writer.Batch<RequestEntryT>
-
- Type Parameters:
RequestEntryT- the type of request entry in this batch
@PublicEvolving public class Batch<RequestEntryT extends Serializable> extends Object
A container for the result of creating a batch of request entries, including:- The actual list of entries forming the batch
- The total size in bytes of those entries
- The total number of entries in the batch
Instances of this class are typically created by a
BatchCreatorto summarize which entries have been selected for sending downstream and to provide any relevant metrics for tracking, such as the byte size or the record count.
-
-
Constructor Summary
Constructors Constructor Description Batch(List<RequestEntryT> requestEntries, long sizeInBytes)Creates a newBatchwith the specified entries, total size, and record count.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<RequestEntryT>getBatchEntries()Returns the list of request entries in this batch.intgetRecordCount()Returns the total number of entries in the batch.longgetSizeInBytes()Returns the total size in bytes of the batch.
-
-
-
Constructor Detail
-
Batch
public Batch(List<RequestEntryT> requestEntries, long sizeInBytes)
Creates a newBatchwith the specified entries, total size, and record count.- Parameters:
requestEntries- the list of request entries that form the batchsizeInBytes- the total size in bytes of the entire batch
-
-
Method Detail
-
getBatchEntries
public List<RequestEntryT> getBatchEntries()
Returns the list of request entries in this batch.- Returns:
- a list of request entries for the batch
-
getSizeInBytes
public long getSizeInBytes()
Returns the total size in bytes of the batch.- Returns:
- the batch's cumulative byte size
-
getRecordCount
public int getRecordCount()
Returns the total number of entries in the batch.- Returns:
- the record count in the batch
-
-