K - Type of a KeyT - Type of a Valuepublic abstract class SimpleBatchingStrategy<K,T> extends BatchingStrategy<com.linkedin.parseq.batching.SimpleBatchingStrategy.Group,K,T>
BatchingStrategy that groups all keys into one batch.DEFAULT_MAX_BATCH_SIZE| Constructor and Description |
|---|
SimpleBatchingStrategy() |
| Modifier and Type | Method and Description |
|---|---|
com.linkedin.parseq.batching.SimpleBatchingStrategy.Group |
classify(K key)
Classify the
K Key and by doing so assign it to a G group. |
abstract void |
executeBatch(Batch<K,T> batch)
This method will be called for a
Batch. |
void |
executeBatch(com.linkedin.parseq.batching.SimpleBatchingStrategy.Group group,
Batch<K,T> batch)
This method will be called for every
Batch. |
String |
getBatchName(Batch<K,T> batch)
Overriding this method allows providing custom name for a batch.
|
String |
getBatchName(com.linkedin.parseq.batching.SimpleBatchingStrategy.Group group,
Batch<K,T> batch)
Overriding this method allows providing custom name for a batch.
|
batchable, batchable, executeBatchWithContext, getBatchAggregationTimeMetric, getBatchSizeMetric, keySize, maxBatchSizeForGrouppublic final com.linkedin.parseq.batching.SimpleBatchingStrategy.Group classify(K key)
BatchingStrategyK Key and by doing so assign it to a G group.
If two keys are classified by the same group then they will belong to the same Batch.
This method needs to be thread safe.classify in class BatchingStrategy<com.linkedin.parseq.batching.SimpleBatchingStrategy.Group,K,T>key - key to be classifiedpublic final void executeBatch(com.linkedin.parseq.batching.SimpleBatchingStrategy.Group group,
Batch<K,T> batch)
BatchingStrategyBatch.
Implementation of this method must make sure that all SettablePromise contained in the Batch
will eventually be resolved - typically asynchronously. Failing to eventually resolve any
of the promises may lead to plan that never completes i.e. appears to hung and may lead to
a memory leak.executeBatch in class BatchingStrategy<com.linkedin.parseq.batching.SimpleBatchingStrategy.Group,K,T>group - group that represents the batchbatch - batch contains collection of SettablePromise that eventually need to be resolved - typically asynchronouslypublic final String getBatchName(com.linkedin.parseq.batching.SimpleBatchingStrategy.Group group, Batch<K,T> batch)
BatchingStrategygetBatchName in class BatchingStrategy<com.linkedin.parseq.batching.SimpleBatchingStrategy.Group,K,T>group - group to be describedbatch - batch to be describedpublic String getBatchName(Batch<K,T> batch)
batch - batch to be describedpublic abstract void executeBatch(Batch<K,T> batch)
Batch.
Implementation of this method must make sure that all SettablePromise contained in the Batch
will eventually be resolved - typically asynchronously. Failing to eventually resolve any
of the promises may lead to plan that never completes i.e. appears to hung and may lead to
a memory leak.batch - batch contains collection of SettablePromise that eventually need to be resolved - typically asynchronouslyCopyright © 2018. All rights reserved.