public class TimestampStartOffsetInitializer extends Object implements StartOffsetInitializer
StartOffsetInitializer to initialize the offsets
based on a timestamp.
Should be initialized through StartOffsetInitializer.
StartOffsetInitializer.CreationConfiguration| Constructor and Description |
|---|
TimestampStartOffsetInitializer(long startingTimestamp) |
| Modifier and Type | Method and Description |
|---|---|
void |
initializeAfterCreation(AbstractPartition partition,
org.apache.pulsar.client.api.Consumer<?> consumer)
Initializes the offset for the given consumer 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, initializeBeforeCreation, latest, latest, offset, offsets, offsets, rollback, timestampspublic TimestampStartOffsetInitializer(long startingTimestamp)
public void initializeAfterCreation(AbstractPartition partition, org.apache.pulsar.client.api.Consumer<?> consumer) throws org.apache.pulsar.client.api.PulsarClientException
StartOffsetInitializerinitializeAfterCreation in interface StartOffsetInitializerpartition - the partition for which the consumer has been createdconsumer - the consumerorg.apache.pulsar.client.api.PulsarClientExceptionpublic 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.