Class AccumulatingBatchReceiver<T>

  • All Implemented Interfaces:
    ThresholdBatchReceiver<T>

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

      Constructors 
      Constructor Description
      AccumulatingBatchReceiver​(com.google.api.core.ApiFuture<?> retFuture)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<T> getBatches()
      Returns the accumulated batches.
      com.google.api.core.ApiFuture<?> processBatch​(T batch)
      Process the given batch asynchronously.
      void validateBatch​(T message)
      Validate that the batch can be received by this ThresholdBatchReceiver.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AccumulatingBatchReceiver

        public AccumulatingBatchReceiver​(com.google.api.core.ApiFuture<?> retFuture)
    • Method Detail

      • 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>
      • getBatches

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