@FunctionalInterface interface OffsetCommitPolicy
offset storage.| Modifier and Type | Method and Description |
|---|---|
static OffsetCommitPolicy |
always()
Get an
OffsetCommitPolicy that will commit offsets as frequently as possible. |
default OffsetCommitPolicy |
and(OffsetCommitPolicy other)
Obtain a new
OffsetCommitPolicy that will commit offsets if both this policy AND the other requests it. |
default OffsetCommitPolicy |
or(OffsetCommitPolicy other)
Obtain a new
OffsetCommitPolicy that will commit offsets if this policy OR the other requests it. |
boolean |
performCommit(long numberOfMessagesSinceLastCommit,
long timeSinceLastCommit,
TimeUnit timeUnit)
Determine if a commit of the offsets should be performed.
|
static OffsetCommitPolicy |
periodic(long minimumTime,
TimeUnit timeUnit)
Get an
OffsetCommitPolicy that will commit offsets no more than the specified time period. |
static OffsetCommitPolicy always()
OffsetCommitPolicy that will commit offsets as frequently as possible. This may result in reduced
performance, but it has the least potential for seeing source records more than once upon restart.static OffsetCommitPolicy periodic(long minimumTime, TimeUnit timeUnit)
OffsetCommitPolicy that will commit offsets no more than the specified time period. If the minimumTime
is not positive, then this method returns always().minimumTime - the minimum amount of time between committing offsetstimeUnit - the time unit for minimumTime; may not be nullboolean performCommit(long numberOfMessagesSinceLastCommit,
long timeSinceLastCommit,
TimeUnit timeUnit)
numberOfMessagesSinceLastCommit - the number of messages that have been received from the connector since last
the offsets were last committed; never negativetimeSinceLastCommit - the time that has elapsed since the offsets were last committed; never negativetimeUnit - the unit of time used for timeSinceLastCommit; never nulltrue if the offsets should be committed, or false otherwisedefault OffsetCommitPolicy or(OffsetCommitPolicy other)
OffsetCommitPolicy that will commit offsets if this policy OR the other requests it.other - the other commit policy; if null, then this policy instance is returned as isdefault OffsetCommitPolicy and(OffsetCommitPolicy other)
OffsetCommitPolicy that will commit offsets if both this policy AND the other requests it.other - the other commit policy; if null, then this policy instance is returned as isCopyright © 2016 JBoss by Red Hat. All rights reserved.