K - Type of a KeyT - Type of a Valuepublic abstract class SimpleTaskBatchingStrategy<K,T> extends TaskBatchingStrategy<com.linkedin.parseq.batching.SimpleBatchingStrategy.Group,K,T>
TaskBatchingStrategy that groups all keys into one batch.DEFAULT_MAX_BATCH_SIZE| Constructor and Description |
|---|
SimpleTaskBatchingStrategy() |
| 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. |
String |
getBatchName(Set<K> batch)
Overriding this method allows providing custom name for a batch.
|
String |
getBatchName(com.linkedin.parseq.batching.SimpleBatchingStrategy.Group group,
Set<K> keys)
Overriding this method allows providing custom name for a batch.
|
abstract com.linkedin.parseq.Task<Map<K,com.linkedin.parseq.function.Try<T>>> |
taskForBatch(Set<K> keys)
This method will be called for every batch.
|
com.linkedin.parseq.Task<Map<K,com.linkedin.parseq.function.Try<T>>> |
taskForBatch(com.linkedin.parseq.batching.SimpleBatchingStrategy.Group group,
Set<K> keys)
This method will be called for every batch.
|
executeBatch, executeBatchWithContext, getBatchNamebatchable, batchable, 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 com.linkedin.parseq.Task<Map<K,com.linkedin.parseq.function.Try<T>>> taskForBatch(com.linkedin.parseq.batching.SimpleBatchingStrategy.Group group, Set<K> keys)
TaskBatchingStrategytaskForBatch in class TaskBatchingStrategy<com.linkedin.parseq.batching.SimpleBatchingStrategy.Group,K,T>group - group that represents the batchkeys - set of keys belonging to the batchpublic final String getBatchName(com.linkedin.parseq.batching.SimpleBatchingStrategy.Group group, Set<K> keys)
TaskBatchingStrategygetBatchName in class TaskBatchingStrategy<com.linkedin.parseq.batching.SimpleBatchingStrategy.Group,K,T>group - group to be describedkeys - set of keys belonging to the batch that needs to be describedpublic String getBatchName(Set<K> batch)
batch - set of keys belonging to the batch that needs to be describedpublic abstract com.linkedin.parseq.Task<Map<K,com.linkedin.parseq.function.Try<T>>> taskForBatch(Set<K> keys)
keys - set of keys belonging to the batchCopyright © 2018. All rights reserved.