public abstract class MappingAggregationPolicy<S,T extends Message> extends Object implements AggregationPolicy<S,T>
Constructor and Description |
---|
MappingAggregationPolicy() |
Modifier and Type | Method and Description |
---|---|
T |
aggregate(T oldBucket,
S newMessage)
Aggregate the given message into an existing bucket, or
create a new bucket if no bucket exists.
|
int |
getCompletionIntervalMs()
Maximum number of milliseconds for which buckets should
continue accumulating messages after creation.
|
int |
getCompletionSize()
Maximum number of messages to be added to a bucket before dispatching.
|
Object |
key(S message)
Calculate a key for the given message.
|
abstract T |
map(S message) |
public Object key(S message)
AggregationPolicy
key
in interface AggregationPolicy<S,T extends Message>
message
- the messagepublic int getCompletionSize()
AggregationPolicy
getCompletionSize
in interface AggregationPolicy<S,T extends Message>
public int getCompletionIntervalMs()
AggregationPolicy
getCompletionIntervalMs
in interface AggregationPolicy<S,T extends Message>
public T aggregate(T oldBucket, S newMessage)
AggregationPolicy
aggregate
in interface AggregationPolicy<S,T extends Message>
oldBucket
- the existing bucket, or null
if a new bucket should be creatednewMessage
- the message to aggregateCopyright © 2017. All rights reserved.