EventDataBatch Interface

public interface EventDataBatch

Helper for creating a batch/collection of EventData objects to be used while Sending to EventHubs

Method Summary

Modifier and Type Method and Description
abstract int getSize()

Get the number of events present in this EventDataBatch

abstract boolean tryAdd(EventData eventData)

Add's EventData to EventDataBatch, if permitted by the batch's size limit.

Method Details

getSize

public abstract int getSize()

Get the number of events present in this EventDataBatch

Returns:

the EventDataBatch size

tryAdd

public abstract boolean tryAdd(EventData eventData)

Add's EventData to EventDataBatch, if permitted by the batch's size limit. This method is not thread-safe.

Parameters:

eventData - The EventData to add.

Returns:

A boolean value indicating if the EventData addition to this batch/collection was successful or not.

Throws:

PayloadSizeExceededException - when a single EventData instance exceeds maximum allowed size of the batch

Applies to