Package com.google.api.gax.batching
Class AccumulatingBatchReceiver<T>
- java.lang.Object
-
- com.google.api.gax.batching.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.voidvalidateBatch(T message)Validate that the batch can be received by this ThresholdBatchReceiver.
-
-
-
Method Detail
-
validateBatch
public void validateBatch(T message)
Description copied from interface:ThresholdBatchReceiverValidate 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:
validateBatchin interfaceThresholdBatchReceiver<T>
-
processBatch
public com.google.api.core.ApiFuture<?> processBatch(T batch)
Description copied from interface:ThresholdBatchReceiverProcess the given batch asynchronously.- Specified by:
processBatchin interfaceThresholdBatchReceiver<T>
-
getBatches
public java.util.List<T> getBatches()
Returns the accumulated batches. If called concurrently withprocessBatch, the new batch may or may not be returned.
-
-