Class Batch<RequestEntryT extends Serializable>

  • 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 BatchCreator to 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 Detail

      • Batch

        public Batch​(List<RequestEntryT> requestEntries,
                     long sizeInBytes)
        Creates a new Batch with the specified entries, total size, and record count.
        Parameters:
        requestEntries - the list of request entries that form the batch
        sizeInBytes - 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