public class MessageDeduplication extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
MessageDeduplication.MessageDupStatus |
static class |
MessageDeduplication.MessageDupUnknownException |
| Constructor and Description |
|---|
MessageDeduplication(PulsarService pulsar,
PersistentTopic topic,
ManagedLedger managedLedger) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
checkStatus()
Check the status of deduplication.
|
long |
getLastPublishedSequenceId(String producerName) |
org.apache.pulsar.broker.service.persistent.MessageDeduplication.Status |
getStatus() |
MessageDeduplication.MessageDupStatus |
isDuplicate(Topic.PublishContext publishContext,
io.netty.buffer.ByteBuf headersAndPayload)
Assess whether the message was already stored in the topic.
|
boolean |
isEnabled() |
void |
producerAdded(String producerName)
Topic will call this method whenever a producer connects.
|
void |
producerRemoved(String producerName)
Topic will call this method whenever a producer disconnects.
|
void |
purgeInactiveProducers()
Remove from hash maps all the producers that were inactive for more than the configured amount of time.
|
void |
recordMessagePersisted(Topic.PublishContext publishContext,
PositionImpl position)
Call this method whenever a message is persisted to get the chance to trigger a snapshot.
|
void |
resetHighestSequenceIdPushed() |
void |
takeSnapshot() |
public MessageDeduplication(PulsarService pulsar, PersistentTopic topic, ManagedLedger managedLedger)
public org.apache.pulsar.broker.service.persistent.MessageDeduplication.Status getStatus()
public CompletableFuture<Void> checkStatus()
public boolean isEnabled()
public MessageDeduplication.MessageDupStatus isDuplicate(Topic.PublishContext publishContext, io.netty.buffer.ByteBuf headersAndPayload)
public void recordMessagePersisted(Topic.PublishContext publishContext, PositionImpl position)
public void resetHighestSequenceIdPushed()
public void producerAdded(String producerName)
public void producerRemoved(String producerName)
public void purgeInactiveProducers()
public long getLastPublishedSequenceId(String producerName)
public void takeSnapshot()
Copyright © 2017–2022 Apache Software Foundation. All rights reserved.