public class ChangelogSSPIterator extends BoundedSSPIterator
SystemStreamPartition
using the provided
SystemConsumer
until all messages have been consumed.
The iterator has a ChangelogSSPIterator.Mode
that depends on its position in the changelog SSP. If trim mode
is enabled, the mode switches to TRIM
if the current message offset is greater than the
provided restoreOffset
, or if restoreOffset
is null.
The iterator mode is used during transactional state restore to determine which changelog SSP entries
should be restored and which ones need to be reverted / trimmed from the changelog topic.Modifier and Type | Class and Description |
---|---|
static class |
ChangelogSSPIterator.Mode |
admin
Constructor and Description |
---|
ChangelogSSPIterator(SystemConsumer systemConsumer,
SystemStreamPartition systemStreamPartition,
java.lang.String restoreOffset,
SystemAdmin admin,
boolean trimEnabled) |
ChangelogSSPIterator(SystemConsumer systemConsumer,
SystemStreamPartition systemStreamPartition,
java.lang.String restoreOffset,
SystemAdmin admin,
boolean trimEnabled,
java.lang.String endOffset) |
Modifier and Type | Method and Description |
---|---|
ChangelogSSPIterator.Mode |
getMode() |
IncomingMessageEnvelope |
next() |
hasNext
public ChangelogSSPIterator(SystemConsumer systemConsumer, SystemStreamPartition systemStreamPartition, java.lang.String restoreOffset, SystemAdmin admin, boolean trimEnabled)
public ChangelogSSPIterator(SystemConsumer systemConsumer, SystemStreamPartition systemStreamPartition, java.lang.String restoreOffset, SystemAdmin admin, boolean trimEnabled, java.lang.String endOffset)
public IncomingMessageEnvelope next()
next
in interface java.util.Iterator<IncomingMessageEnvelope>
next
in class BoundedSSPIterator
public ChangelogSSPIterator.Mode getMode()