S
- type of message that will be sent by the producersT
- type of message (bucket) that will be received by the consumerspublic interface AggregationPolicy<S,T>
SinkModule
defines a AggregationPolicy
, messages
will be aggregated into "buckets", which are keyed based on the object
returned by key(Object)
.
The aggregation function #aggregate(Message, Object)
is called to
create buckets and combine messages into an existing bucket.
The completion size and completion interval options determine the conditions
under which the buckets will be dispatched.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.
|
int getCompletionSize()
int getCompletionIntervalMs()
Object key(S message)
message
- the messageCopyright © 2017. All rights reserved.