public class PersistentReplicator extends AbstractReplicator implements Replicator, AsyncCallbacks.ReadEntriesCallback, AsyncCallbacks.DeleteCallback
AbstractReplicator.State| Modifier and Type | Field and Description |
|---|---|
protected ManagedCursor |
cursor |
backOff, brokerService, client, localCluster, producer, producerBuilder, producerQueueSize, remoteCluster, REPL_PRODUCER_NAME_DELIMITER, replicationClient, replicatorPrefix, STATE_UPDATER, topicName| Constructor and Description |
|---|
PersistentReplicator(PersistentTopic topic,
ManagedCursor cursor,
String localCluster,
String remoteCluster,
BrokerService brokerService,
PulsarClientImpl replicationClient) |
closeProducerAsync, getRemoteCluster, getRemoteCluster, getReplicatorName, isWritable, remove, startProducer, validatePartitionedTopicAsyncclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetRemoteCluster, startProducerprotected final ManagedCursor cursor
public PersistentReplicator(PersistentTopic topic, ManagedCursor cursor, String localCluster, String remoteCluster, BrokerService brokerService, PulsarClientImpl replicationClient) throws PulsarServerException
PulsarServerExceptionprotected void readEntries(org.apache.pulsar.client.api.Producer<byte[]> producer)
readEntries in class AbstractReplicatorprotected Position getReplicatorReadPosition()
getReplicatorReadPosition in class AbstractReplicatorprotected long getNumberOfEntriesInBacklog()
getNumberOfEntriesInBacklog in class AbstractReplicatorprotected void disableReplicatorRead()
disableReplicatorRead in class AbstractReplicatorprotected void readMoreEntries()
public void readEntriesComplete(List<Entry> entries, Object ctx)
readEntriesComplete in interface AsyncCallbacks.ReadEntriesCallbackpublic void updateCursorState()
public void readEntriesFailed(ManagedLedgerException exception, Object ctx)
readEntriesFailed in interface AsyncCallbacks.ReadEntriesCallbackpublic CompletableFuture<Void> clearBacklog()
public CompletableFuture<Void> skipMessages(int numMessagesToSkip)
public CompletableFuture<Entry> peekNthMessage(int messagePosition)
public void deleteComplete(Object ctx)
deleteComplete in interface AsyncCallbacks.DeleteCallbackpublic void deleteFailed(ManagedLedgerException exception, Object ctx)
deleteFailed in interface AsyncCallbacks.DeleteCallbackpublic void updateRates()
updateRates in interface Replicatorpublic org.apache.pulsar.common.policies.data.stats.ReplicatorStatsImpl getStats()
getStats in interface Replicatorpublic void updateMessageTTL(int messageTTLInSeconds)
public boolean expireMessages(int messageTTLInSeconds)
public boolean expireMessages(Position position)
public Optional<DispatchRateLimiter> getRateLimiter()
getRateLimiter in interface Replicatorpublic void initializeDispatchRateLimiterIfNeeded(Optional<org.apache.pulsar.common.policies.data.Policies> policies)
initializeDispatchRateLimiterIfNeeded in interface Replicatorpublic CompletableFuture<Void> disconnect()
disconnect in interface Replicatordisconnect in class AbstractReplicatorpublic CompletableFuture<Void> disconnect(boolean failIfHasBacklog)
disconnect in interface Replicatordisconnect in class AbstractReplicatorpublic boolean isConnected()
isConnected in interface ReplicatorCopyright © 2017–2022 Apache Software Foundation. All rights reserved.