public class RollbackStartOffsetInitializer extends Object implements StartOffsetInitializer
StartOffsetInitializer to rollback the offsets
by a certain duration.
This implementation does not verify if data exists after the rollback as this initiliazer
Package private and should be instantiated via StartOffsetInitializer.
StartOffsetInitializer.CreationConfiguration| Constructor and Description |
|---|
RollbackStartOffsetInitializer(long rollbackTimeInS) |
| Modifier and Type | Method and Description |
|---|---|
void |
initializeBeforeCreation(AbstractPartition partition,
StartOffsetInitializer.CreationConfiguration creationConfiguration)
Initializes the offset for the given consumer configuration and partition.
|
Optional<String> |
verifyOffset(AbstractPartition partition,
Supplier<Optional<org.apache.pulsar.client.api.MessageId>> lastMessageIdFetcher,
Supplier<Optional<org.apache.pulsar.client.api.Message<byte[]>>> firstMessageFetcher)
Verifies if the offset was initialized correctly.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcommittedOffsets, committedOffsets, earliest, earliest, initializeAfterCreation, latest, latest, offset, offsets, offsets, rollback, timestampspublic RollbackStartOffsetInitializer(long rollbackTimeInS)
public void initializeBeforeCreation(AbstractPartition partition, StartOffsetInitializer.CreationConfiguration creationConfiguration)
StartOffsetInitializerinitializeBeforeCreation in interface StartOffsetInitializerpartition - the partition for which the consumer is about to be createdcreationConfiguration - the configuration used to create consumerpublic Optional<String> verifyOffset(AbstractPartition partition, Supplier<Optional<org.apache.pulsar.client.api.MessageId>> lastMessageIdFetcher, Supplier<Optional<org.apache.pulsar.client.api.Message<byte[]>>> firstMessageFetcher)
StartOffsetInitializerverifyOffset in interface StartOffsetInitializerPulsarSourceOptions.VERIFY_INITIAL_OFFSETSCopyright © 2019–2021 The Apache Software Foundation. All rights reserved.