Class PersistentTopic
java.lang.Object
org.apache.pulsar.broker.service.AbstractTopic
org.apache.pulsar.broker.service.persistent.PersistentTopic
- All Implemented Interfaces:
AsyncCallbacks.AddEntryCallback
,Topic
,TopicPolicyListener<org.apache.pulsar.common.policies.data.TopicPolicies>
- Direct Known Subclasses:
SystemTopic
public class PersistentTopic
extends AbstractTopic
implements Topic, AsyncCallbacks.AddEntryCallback
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.pulsar.broker.service.Topic
Topic.PublishContext
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ManagedLedger
static final int
protected final MessageDeduplication
boolean
protected final TransactionBuffer
Fields inherited from class org.apache.pulsar.broker.service.AbstractTopic
addEntryLatencyStatsUsec, brokerService, bytesOutFromRemovedSubscriptions, entryFilters, hasBatchMessagePublished, isAllowAutoUpdateSchema, isEncryptionRequired, isFenced, lastActive, lock, msgOutFromRemovedSubscriptions, preciseTopicPublishRateLimitingEnable, producers, publishRateLimitedTimes, replicatorPrefix, resourceGroupPublishLimiter, resourceGroupRateLimitingEnabled, topic, topicEpoch, topicPolicies, topicPublishRateLimiter, transferring, userCreatedProducerCount
-
Constructor Summary
ConstructorDescriptionPersistentTopic
(String topic, ManagedLedger ledger, BrokerService brokerService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addComplete
(Position pos, io.netty.buffer.ByteBuf entryData, Object ctx) void
addFailed
(ManagedLedgerException exception, Object ctx) addProducer
(Producer producer, CompletableFuture<Void> producerQueuedFuture) Tries to add a producer to the topic.protected CompletableFuture<Void>
addReplicationCluster
(String remoteCluster, ManagedCursor cursor, String localCluster) addSchemaIfIdleOrCheckCompatible
(org.apache.pulsar.common.protocol.schema.SchemaData schema) If the topic is idle (no producers, no entries, no subscribers and no existing schema), add the passed schema to the topic.protected CompletableFuture<Void>
addShadowReplicationCluster
(String shadowTopic, ManagedCursor cursor) CompletableFuture<org.apache.pulsar.common.policies.data.stats.TopicStatsImpl>
asyncGetStats
(boolean getPreciseBacklog, boolean subscriptionBacklogSize, boolean getEarliestTimeInBacklog) CompletableFuture<? extends org.apache.pulsar.common.policies.data.stats.TopicStatsImpl>
asyncGetStats
(GetStatsOptions getStatsOptions) void
asyncReadEntry
(PositionImpl position, AsyncCallbacks.ReadEntryCallback callback, Object ctx) void
Activate cursors those caught up backlog-threshold entries and deactivate slow cursors which are creating backlog.checkBacklogQuotaExceeded
(String producerName, org.apache.pulsar.common.policies.data.BacklogQuota.BacklogQuotaType backlogQuotaType) void
void
void
void
checkGC()
checkIfTransactionBufferRecoverCompletely
(boolean isTxnEnabled) Wait TransactionBuffer Recovers completely.void
void
void
void
void
boolean
checkSubscriptionTypesEnable
(org.apache.pulsar.common.api.proto.CommandSubscribe.SubType subType) Clears backlog for all cursors in the topic.clearBacklog
(String cursorName) Clears backlog for a given cursor in the topic.close()
close
(boolean closeWithoutWaitingClientDisconnect) close
(boolean disconnectClients, boolean closeWithoutWaitingClientDisconnect) Close this topic - close all producers and subscriptions associated with this topic.createSubscription
(String subscriptionName, org.apache.pulsar.common.api.proto.CommandSubscribe.InitialPosition initialPosition, boolean replicateSubscriptionState, Map<String, String> subscriptionProperties) delete()
Delete the managed ledger associated with this topic.Forcefully close all producers/consumers/replicators and deletes the topic.CompletableFuture<org.apache.pulsar.common.protocol.schema.SchemaVersion>
Delete the schema if this topic has a schema defined for it.endTxn
(org.apache.pulsar.client.api.transaction.TxnID txnID, int txnAction, long lowWaterMark) End the transaction in this topic.org.apache.pulsar.common.policies.data.BacklogQuota
getBacklogQuota
(org.apache.pulsar.common.policies.data.BacklogQuota.BacklogQuotaType backlogQuotaType) long
long
CompletableFuture<org.apache.pulsar.common.policies.data.PersistentTopicInternalStats>
getInternalStats
(boolean includeLedgerMetadata) long
CompletableFuture<org.apache.pulsar.client.api.MessageId>
long
getLastPublishedSequenceId
(String producerName) double
double
int
int
long
int
getNumberOfSameAddressConsumers
(String clientAddress) getPendingAckManagedLedger
(String subName) getPersistentReplicator
(String remoteCluster) getPositionAfterN
(PositionImpl startPosition, long n) org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap<String,
Replicator> protected String
org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap<String,
Replicator> Optional<org.apache.pulsar.common.naming.TopicName>
org.apache.pulsar.common.policies.data.stats.TopicStatsImpl
getStats
(boolean getPreciseBacklog, boolean subscriptionBacklogSize, boolean getEarliestTimeInBacklog) org.apache.pulsar.common.policies.data.stats.TopicStatsImpl
getStats
(GetStatsOptions getStatsOptions) getSubscription
(String subscriptionName) org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap<String,
PersistentSubscription> org.apache.pulsar.common.policies.data.TransactionBufferStats
getTransactionBufferStats
(boolean lowWaterMarks) org.apache.pulsar.common.policies.data.TransactionBufferStats
getTransactionBufferStats
(boolean lowWaterMarks, boolean segmentStats) org.apache.pulsar.common.policies.data.TransactionInBufferStats
getTransactionInBufferStats
(org.apache.pulsar.client.api.transaction.TxnID txnID) org.apache.pulsar.common.policies.data.TransactionInPendingAckStats
getTransactionInPendingAckStats
(org.apache.pulsar.client.api.transaction.TxnID txnID, String subName) org.apache.pulsar.common.policies.data.TransactionPendingAckStats
getTransactionPendingAckStats
(String subName, boolean lowWaterMarks) protected void
handleProducerRemoved
(Producer producer) protected CompletableFuture<Long>
incrementTopicEpoch
(Optional<Long> currentEpoch) protected CompletableFuture<Void>
boolean
isActive
(org.apache.pulsar.common.policies.data.InactiveTopicDeleteMode deleteMode) boolean
static boolean
isCompactionSubscription
(String subscriptionName) static boolean
isDedupCursorName
(String name) boolean
boolean
boolean
boolean
isOldestMessageExpired
(ManagedCursor cursor, int messageTTLInSeconds) boolean
boolean
boolean
boolean
boolean
boolean
protected boolean
boolean
isTxnAborted
(org.apache.pulsar.client.api.transaction.TxnID txnID, PositionImpl readPosition) onPoliciesUpdate
(org.apache.pulsar.common.policies.data.Policies data) void
onUpdate
(org.apache.pulsar.common.policies.data.TopicPolicies policies) void
publishMessage
(io.netty.buffer.ByteBuf headersAndPayload, Topic.PublishContext publishContext) void
publishTxnMessage
(org.apache.pulsar.client.api.transaction.TxnID txnID, io.netty.buffer.ByteBuf headersAndPayload, Topic.PublishContext publishContext) Publish Transaction message to this Topic's TransactionBuffer.protected CompletableFuture<Long>
setTopicEpoch
(long newEpoch) boolean
subscribe
(SubscriptionOption option) Subscribe a topic.subscribe
(TransportCnx cnx, String subscriptionName, long consumerId, org.apache.pulsar.common.api.proto.CommandSubscribe.SubType subType, int priorityLevel, String consumerName, boolean isDurable, org.apache.pulsar.client.api.MessageId startMessageId, Map<String, String> metadata, boolean readCompacted, org.apache.pulsar.common.api.proto.CommandSubscribe.InitialPosition initialPosition, long startMessageRollbackDurationSec, boolean replicatedSubscriptionStateArg, org.apache.pulsar.common.api.proto.KeySharedMeta keySharedMeta) CompletableFuture<org.apache.pulsar.client.api.MessageId>
void
void
triggerOffload
(MessageIdImpl messageId) truncate()
Truncate a topic.unloadSubscription
(String subName) Unload a subscriber.unsubscribe
(String subscriptionName) Delete the cursor ledger for a given subscription.void
void
updateRates
(NamespaceStats nsStats, org.apache.pulsar.policies.data.loadbalancer.NamespaceBundleStats bundleStats, StatsOutputStream topicStatsStream, ClusterReplicationMetrics replStats, String namespace, boolean hydratePublishers) void
Methods inherited from class org.apache.pulsar.broker.service.AbstractTopic
addConsumerToSubscription, addFilteredEntriesCount, addSchema, checkSchemaCompatibleForConsumer, checkTopicFenced, currentUsageCount, decrementUsageCount, deletePartitionedTopicMetadataWhileInactive, deleteTopicPolicies, getActiveConsumer, getBrokerPublishRateLimiter, getBrokerService, getBytesInCounter, getBytesOutCounter, getDispatchRate, getEntryFilters, getEntryFiltersPolicy, getFilteredEntriesCount, getHierarchyTopicPolicies, getInactiveTopicPolicies, getMigratedClusterUrl, getMigratedClusterUrl, getMigratedClusterUrlAsync, getMsgInCounter, getMsgOutCounter, getName, getNumberOfSameAddressConsumers, getNumberOfSameAddressProducers, getProducers, getReplicatorDispatchRate, getReplicatorPrefix, getSchemaCompatibilityStrategy, getSchemaValidationEnforced, getSubscribeRate, getSubscriptionDispatchRate, getTopicPolicies, getTopicPublishRateLimiter, getWaitingProducersCount, handleConsumerAdded, hasLocalProducers, hasSchema, increasePublishLimitedTimes, incrementPublishCount, incrementTopicEpochIfNeeded, internalAddProducer, isClusterMigrationEnabled, isConsumersExceededOnTopic, isDeleteWhileInactive, isEncryptionRequired, isExceedMaximumMessageSize, isProducersExceeded, isSameAddressConsumersExceededOnTopic, isSameAddressProducersExceeded, isTransferring, markBatchMessagePublished, recordAddLatency, registerTopicPolicyListener, removeProducer, toString, unregisterTopicPolicyListener, updateBrokerDispatchRate, updateBrokerPublishRate, updateBrokerReplicatorDispatchRate, updateBrokerSubscribeRate, updateBrokerSubscriptionDispatchRate, updateBrokerSubscriptionTypesEnabled, updateEntryFilters, updatePublishDispatcher, updateResourceGroupLimiter, updateResourceGroupLimiter, updateTopicPolicy, updateTopicPolicyByNamespacePolicy
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.pulsar.broker.service.Topic
addSchema, checkSchemaCompatibleForConsumer, getBrokerService, getEntryFilters, getEntryFiltersPolicy, getHierarchyTopicPolicies, getName, getProducers, getSchemaValidationEnforced, hasSchema, increasePublishLimitedTimes, incrementPublishCount, isEncryptionRequired, isTransferring, recordAddLatency, removeProducer
-
Field Details
-
ledger
-
msgChunkPublished
public boolean msgChunkPublished -
MESSAGE_RATE_BACKOFF_MS
public static final int MESSAGE_RATE_BACKOFF_MS- See Also:
-
messageDeduplication
-
transactionBuffer
-
-
Constructor Details
-
PersistentTopic
-
-
Method Details
-
isDedupCursorName
-
initialize
- Specified by:
initialize
in interfaceTopic
-
getPendingWriteOps
-
unloadSubscription
Unload a subscriber.- Throws:
BrokerServiceException.SubscriptionNotFoundException
- If subscription not founded.BrokerServiceException.UnsupportedSubscriptionException
- If the subscription is typed compaction.BrokerServiceException.SubscriptionConflictUnloadException
- Conflict topic-close, topic-delete, another-subscribe-unload, cannot unload subscription now
-
isCompactionSubscription
-
publishMessage
public void publishMessage(io.netty.buffer.ByteBuf headersAndPayload, Topic.PublishContext publishContext) - Specified by:
publishMessage
in interfaceTopic
-
updateSubscribeRateLimiter
public void updateSubscribeRateLimiter() -
asyncReadEntry
public void asyncReadEntry(PositionImpl position, AsyncCallbacks.ReadEntryCallback callback, Object ctx) -
getPositionAfterN
public PositionImpl getPositionAfterN(PositionImpl startPosition, long n) throws ManagedLedgerException - Throws:
ManagedLedgerException
-
getFirstPosition
- Throws:
ManagedLedgerException
-
getNumberOfEntries
public long getNumberOfEntries() -
addComplete
- Specified by:
addComplete
in interfaceAsyncCallbacks.AddEntryCallback
-
addFailed
- Specified by:
addFailed
in interfaceAsyncCallbacks.AddEntryCallback
-
addProducer
public CompletableFuture<Optional<Long>> addProducer(Producer producer, CompletableFuture<Void> producerQueuedFuture) Description copied from interface:Topic
Tries to add a producer to the topic. Several validations will be performed.- Specified by:
addProducer
in interfaceTopic
- Overrides:
addProducer
in classAbstractTopic
producerQueuedFuture
- a future that will be triggered if the producer is being queued up prior of getting established- Returns:
- the "topic epoch" if there is one or empty
-
checkIfTransactionBufferRecoverCompletely
Description copied from interface:Topic
Wait TransactionBuffer Recovers completely. Take snapshot after TB Recovers completely.- Specified by:
checkIfTransactionBufferRecoverCompletely
in interfaceTopic
- Returns:
- a future which has completely if isTxn = false. Or a future return by takeSnapshot.
-
incrementTopicEpoch
- Specified by:
incrementTopicEpoch
in classAbstractTopic
-
setTopicEpoch
- Specified by:
setTopicEpoch
in classAbstractTopic
-
startReplProducers
-
stopReplProducers
-
handleProducerRemoved
- Overrides:
handleProducerRemoved
in classAbstractTopic
-
subscribe
Description copied from interface:Topic
Subscribe a topic. -
createSubscription
public CompletableFuture<Subscription> createSubscription(String subscriptionName, org.apache.pulsar.common.api.proto.CommandSubscribe.InitialPosition initialPosition, boolean replicateSubscriptionState, Map<String, String> subscriptionProperties) - Specified by:
createSubscription
in interfaceTopic
-
unsubscribe
Delete the cursor ledger for a given subscription.- Specified by:
unsubscribe
in interfaceTopic
- Parameters:
subscriptionName
- Subscription for which the cursor ledger is to be deleted- Returns:
- Completable future indicating completion of unsubscribe operation Completed exceptionally with: ManagedLedgerException if cursor ledger delete fails
-
delete
Delete the managed ledger associated with this topic. -
deleteForcefully
Forcefully close all producers/consumers/replicators and deletes the topic. this function is used when local cluster is removed from global-namespace replication list. Because broker doesn't allow lookup if local cluster is not part of replication cluster list.- Specified by:
deleteForcefully
in interfaceTopic
- Returns:
-
close
-
close
-
close
public CompletableFuture<Void> close(boolean disconnectClients, boolean closeWithoutWaitingClientDisconnect) Close this topic - close all producers and subscriptions associated with this topic. -
checkDeduplicationStatus
-
checkReplication
- Specified by:
checkReplication
in interfaceTopic
-
checkMessageExpiry
public void checkMessageExpiry()- Specified by:
checkMessageExpiry
in interfaceTopic
-
checkMessageDeduplicationInfo
public void checkMessageDeduplicationInfo()- Specified by:
checkMessageDeduplicationInfo
in interfaceTopic
-
isCompactionEnabled
public boolean isCompactionEnabled() -
checkCompaction
public void checkCompaction() -
preCreateSubscriptionForCompactionIfNeeded
-
addReplicationCluster
protected CompletableFuture<Void> addReplicationCluster(String remoteCluster, ManagedCursor cursor, String localCluster) -
addShadowReplicationCluster
protected CompletableFuture<Void> addShadowReplicationCluster(String shadowTopic, ManagedCursor cursor) -
isDeduplicationEnabled
public boolean isDeduplicationEnabled() -
getNumberOfConsumers
public int getNumberOfConsumers()- Specified by:
getNumberOfConsumers
in classAbstractTopic
-
getNumberOfSameAddressConsumers
- Specified by:
getNumberOfSameAddressConsumers
in classAbstractTopic
-
getSchemaId
- Overrides:
getSchemaId
in classAbstractTopic
-
getSubscriptions
public org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap<String,PersistentSubscription> getSubscriptions()- Specified by:
getSubscriptions
in interfaceTopic
-
getSubscription
- Specified by:
getSubscription
in interfaceTopic
-
getReplicators
public org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap<String,Replicator> getReplicators()- Specified by:
getReplicators
in interfaceTopic
-
getShadowReplicators
public org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap<String,Replicator> getShadowReplicators()- Specified by:
getShadowReplicators
in interfaceTopic
-
getPersistentReplicator
-
getManagedLedger
-
updateRates
public void updateRates(NamespaceStats nsStats, org.apache.pulsar.policies.data.loadbalancer.NamespaceBundleStats bundleStats, StatsOutputStream topicStatsStream, ClusterReplicationMetrics replStats, String namespace, boolean hydratePublishers) - Specified by:
updateRates
in interfaceTopic
-
getLastUpdatedAvgPublishRateInMsg
public double getLastUpdatedAvgPublishRateInMsg() -
getLastUpdatedAvgPublishRateInByte
public double getLastUpdatedAvgPublishRateInByte() -
getStats
public org.apache.pulsar.common.policies.data.stats.TopicStatsImpl getStats(boolean getPreciseBacklog, boolean subscriptionBacklogSize, boolean getEarliestTimeInBacklog) -
getStats
public org.apache.pulsar.common.policies.data.stats.TopicStatsImpl getStats(GetStatsOptions getStatsOptions) -
asyncGetStats
public CompletableFuture<org.apache.pulsar.common.policies.data.stats.TopicStatsImpl> asyncGetStats(boolean getPreciseBacklog, boolean subscriptionBacklogSize, boolean getEarliestTimeInBacklog) - Specified by:
asyncGetStats
in interfaceTopic
-
asyncGetStats
public CompletableFuture<? extends org.apache.pulsar.common.policies.data.stats.TopicStatsImpl> asyncGetStats(GetStatsOptions getStatsOptions) - Specified by:
asyncGetStats
in interfaceTopic
-
deleteSchema
Description copied from interface:Topic
Delete the schema if this topic has a schema defined for it.- Specified by:
deleteSchema
in interfaceTopic
- Overrides:
deleteSchema
in classAbstractTopic
-
getInternalStats
public CompletableFuture<org.apache.pulsar.common.policies.data.PersistentTopicInternalStats> getInternalStats(boolean includeLedgerMetadata) - Specified by:
getInternalStats
in interfaceTopic
-
getCompactedTopicContext
-
getBacklogSize
public long getBacklogSize() -
isActive
public boolean isActive(org.apache.pulsar.common.policies.data.InactiveTopicDeleteMode deleteMode) -
checkClusterMigration
- Specified by:
checkClusterMigration
in interfaceTopic
-
shouldProducerMigrate
public boolean shouldProducerMigrate()- Specified by:
shouldProducerMigrate
in interfaceTopic
-
isReplicationBacklogExist
public boolean isReplicationBacklogExist()- Specified by:
isReplicationBacklogExist
in interfaceTopic
-
checkGC
public void checkGC() -
checkInactiveSubscriptions
public void checkInactiveSubscriptions()- Specified by:
checkInactiveSubscriptions
in interfaceTopic
-
checkBackloggedCursors
public void checkBackloggedCursors()Description copied from interface:Topic
Activate cursors those caught up backlog-threshold entries and deactivate slow cursors which are creating backlog.- Specified by:
checkBackloggedCursors
in interfaceTopic
-
checkInactiveLedgers
public void checkInactiveLedgers() -
checkCursorsToCacheEntries
public void checkCursorsToCacheEntries()- Specified by:
checkCursorsToCacheEntries
in interfaceTopic
-
checkDeduplicationSnapshot
public void checkDeduplicationSnapshot()- Specified by:
checkDeduplicationSnapshot
in interfaceTopic
-
onLocalPoliciesUpdate
-
updateDispatchRateLimiter
public void updateDispatchRateLimiter()- Overrides:
updateDispatchRateLimiter
in classAbstractTopic
-
onPoliciesUpdate
public CompletableFuture<Void> onPoliciesUpdate(@Nonnull org.apache.pulsar.common.policies.data.Policies data) - Specified by:
onPoliciesUpdate
in interfaceTopic
-
getBacklogQuota
public org.apache.pulsar.common.policies.data.BacklogQuota getBacklogQuota(org.apache.pulsar.common.policies.data.BacklogQuota.BacklogQuotaType backlogQuotaType) - Specified by:
getBacklogQuota
in interfaceTopic
- Returns:
- Backlog quota for topic
-
checkBacklogQuotaExceeded
public CompletableFuture<Void> checkBacklogQuotaExceeded(String producerName, org.apache.pulsar.common.policies.data.BacklogQuota.BacklogQuotaType backlogQuotaType) - Specified by:
checkBacklogQuotaExceeded
in interfaceTopic
- Returns:
- quota exceeded status for blocking producer creation
-
isSizeBacklogExceeded
public boolean isSizeBacklogExceeded()- Returns:
- determine if backlog quota enforcement needs to be done for topic based on size limit
-
checkTimeBacklogExceeded
- Returns:
- determine if backlog quota enforcement needs to be done for topic based on time limit
-
isReplicated
public boolean isReplicated()- Specified by:
isReplicated
in interfaceTopic
-
isShadowReplicated
public boolean isShadowReplicated()- Specified by:
isShadowReplicated
in interfaceTopic
-
terminate
-
isOldestMessageExpired
-
clearBacklog
Clears backlog for all cursors in the topic.- Returns:
-
clearBacklog
Clears backlog for a given cursor in the topic.Note: For a replication cursor, just provide the remote cluster name
- Parameters:
cursorName
-- Returns:
-
getDispatchRateLimiter
- Specified by:
getDispatchRateLimiter
in interfaceTopic
-
getBrokerDispatchRateLimiter
- Specified by:
getBrokerDispatchRateLimiter
in interfaceTopic
-
getSubscribeRateLimiter
- Specified by:
getSubscribeRateLimiter
in interfaceTopic
-
getLastPublishedSequenceId
-
getLastPosition
- Specified by:
getLastPosition
in interfaceTopic
-
getLastMessageId
- Specified by:
getLastMessageId
in interfaceTopic
-
triggerCompaction
public void triggerCompaction() throws PulsarServerException, BrokerServiceException.AlreadyRunningException -
compactionStatus
-
triggerOffload
public void triggerOffload(MessageIdImpl messageId) throws BrokerServiceException.AlreadyRunningException -
offloadStatus
-
addSchemaIfIdleOrCheckCompatible
public CompletableFuture<Void> addSchemaIfIdleOrCheckCompatible(org.apache.pulsar.common.protocol.schema.SchemaData schema) Description copied from interface:Topic
If the topic is idle (no producers, no entries, no subscribers and no existing schema), add the passed schema to the topic. Otherwise, check that the passed schema is compatible with what the topic already has.- Specified by:
addSchemaIfIdleOrCheckCompatible
in interfaceTopic
-
checkReplicatedSubscriptionControllerState
public void checkReplicatedSubscriptionControllerState() -
getReplicatedSubscriptionController
-
getTopicCompactionService
-
isSystemTopic
public boolean isSystemTopic()- Specified by:
isSystemTopic
in interfaceTopic
-
isPersistent
public boolean isPersistent()- Specified by:
isPersistent
in interfaceTopic
-
publishTxnMessage
public void publishTxnMessage(org.apache.pulsar.client.api.transaction.TxnID txnID, io.netty.buffer.ByteBuf headersAndPayload, Topic.PublishContext publishContext) Description copied from interface:Topic
Publish Transaction message to this Topic's TransactionBuffer.- Specified by:
publishTxnMessage
in interfaceTopic
- Parameters:
txnID
- Transaction IdheadersAndPayload
- Message datapublishContext
- Publish context
-
endTxn
public CompletableFuture<Void> endTxn(org.apache.pulsar.client.api.transaction.TxnID txnID, int txnAction, long lowWaterMark) Description copied from interface:Topic
End the transaction in this topic. -
truncate
Description copied from interface:Topic
Truncate a topic. The truncate operation will move all cursors to the end of the topic and delete all inactive ledgers. -
getDelayedDeliveryTickTimeMillis
public long getDelayedDeliveryTickTimeMillis() -
isDelayedDeliveryEnabled
public boolean isDelayedDeliveryEnabled() -
getMaxUnackedMessagesOnSubscription
public int getMaxUnackedMessagesOnSubscription() -
onUpdate
public void onUpdate(org.apache.pulsar.common.policies.data.TopicPolicies policies) - Specified by:
onUpdate
in interfaceTopicPolicyListener<org.apache.pulsar.common.policies.data.TopicPolicies>
-
initTopicPolicy
-
getMessageDeduplication
-
checkSubscriptionTypesEnable
public boolean checkSubscriptionTypesEnable(org.apache.pulsar.common.api.proto.CommandSubscribe.SubType subType) -
getTransactionBufferStats
public org.apache.pulsar.common.policies.data.TransactionBufferStats getTransactionBufferStats(boolean lowWaterMarks) -
getTransactionBufferStats
public org.apache.pulsar.common.policies.data.TransactionBufferStats getTransactionBufferStats(boolean lowWaterMarks, boolean segmentStats) -
getTransactionPendingAckStats
public org.apache.pulsar.common.policies.data.TransactionPendingAckStats getTransactionPendingAckStats(String subName, boolean lowWaterMarks) -
getMaxReadPosition
-
isTxnAborted
public boolean isTxnAborted(org.apache.pulsar.client.api.transaction.TxnID txnID, PositionImpl readPosition) -
getTransactionInBufferStats
public org.apache.pulsar.common.policies.data.TransactionInBufferStats getTransactionInBufferStats(org.apache.pulsar.client.api.transaction.TxnID txnID) -
isTerminated
protected boolean isTerminated()- Specified by:
isTerminated
in classAbstractTopic
-
isMigrated
public boolean isMigrated()- Specified by:
isMigrated
in classAbstractTopic
-
getTransactionInPendingAckStats
public org.apache.pulsar.common.policies.data.TransactionInPendingAckStats getTransactionInPendingAckStats(org.apache.pulsar.client.api.transaction.TxnID txnID, String subName) -
getPendingAckManagedLedger
-
getLastDataMessagePublishedTimestamp
public long getLastDataMessagePublishedTimestamp() -
getShadowSourceTopic
-