Class AccumulatingBatchReceiver<T>

java.lang.Object
com.google.api.gax.batching.AccumulatingBatchReceiver<T>
All Implemented Interfaces:
ThresholdBatchReceiver<T>

public final class AccumulatingBatchReceiver<T> extends Object implements ThresholdBatchReceiver<T>
A simple ThresholdBatchReceiver that just accumulates batches.
  • Constructor Details

    • AccumulatingBatchReceiver

      public AccumulatingBatchReceiver(ApiFuture<?> retFuture)
  • Method Details

    • validateBatch

      public void validateBatch(T message)
      Description copied from interface: ThresholdBatchReceiver
      Validate that the batch can be received by this ThresholdBatchReceiver. This is called to validate a batch before it is sent to the ThresholdBatcher.
      Specified by:
      validateBatch in interface ThresholdBatchReceiver<T>
    • processBatch

      public ApiFuture<?> processBatch(T batch)
      Description copied from interface: ThresholdBatchReceiver
      Process the given batch asynchronously.
      Specified by:
      processBatch in interface ThresholdBatchReceiver<T>
    • getBatches

      public List<T> getBatches()
      Returns the accumulated batches. If called concurrently with processBatch, the new batch may or may not be returned.