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
- 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
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected final ManagedLedgerstatic final intprotected final MessageDeduplicationbooleanprotected final TransactionBufferFields inherited from class org.apache.pulsar.broker.service.AbstractTopic
addEntryLatencyStatsUsec, additionalSystemCursorNames, brokerService, bytesOutFromRemovedSubscriptions, bytesOutFromRemovedSystemSubscriptions, clock, entryFilters, hasBatchMessagePublished, isAllowAutoUpdateSchema, isEncryptionRequired, isFenced, lastActive, lock, msgOutFromRemovedSubscriptions, preciseTopicPublishRateLimitingEnable, producers, publishRateLimitedTimes, replicatorPrefix, resourceGroupPublishLimiter, resourceGroupRateLimitingEnabled, topic, topicEpoch, topicPolicies, topicPublishRateLimiter, totalPublishRateLimitedCounter, transferring, userCreatedProducerCount -
Constructor Summary
ConstructorsConstructorDescriptionPersistentTopic(String topic, ManagedLedger ledger, BrokerService brokerService) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComplete(Position pos, io.netty.buffer.ByteBuf entryData, Object ctx) voidaddFailed(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) voidasyncReadEntry(Position position, AsyncCallbacks.ReadEntryCallback callback, Object ctx) voidActivate 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) voidvoidvoidvoidcheckGC()Wait TransactionBuffer recovers completely.voidvoidvoidcheckInactiveSubscriptions(long expirationTimeMillis) voidvoidvoidbooleancheckSubscriptionTypesEnable(org.apache.pulsar.common.api.proto.CommandSubscribe.SubType subType) checkTimeBacklogExceeded(boolean shouldUpdateOldPositionInfo) 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.BacklogQuotagetBacklogQuota(org.apache.pulsar.common.policies.data.BacklogQuota.BacklogQuotaType backlogQuotaType) longlongUses the best-effort (not necessarily up-to-date) information available to return the age.longlongCompletableFuture<org.apache.pulsar.common.policies.data.PersistentTopicInternalStats>getInternalStats(boolean includeLedgerMetadata) Get the last message position that can be dispatch.CompletableFuture<org.apache.pulsar.client.api.MessageId>longgetLastPublishedSequenceId(String producerName) doubledoubleintintlongintgetNumberOfSameAddressConsumers(String clientAddress) getPendingAckManagedLedger(String subName) getPersistentReplicator(String remoteCluster) getPositionAfterN(Position startPosition, long n) protected StringOptional<org.apache.pulsar.common.naming.TopicName>org.apache.pulsar.common.policies.data.stats.TopicStatsImplgetStats(boolean getPreciseBacklog, boolean subscriptionBacklogSize, boolean getEarliestTimeInBacklog) org.apache.pulsar.common.policies.data.stats.TopicStatsImplgetStats(GetStatsOptions getStatsOptions) getSubscription(String subscriptionName) Get OpenTelemetry attribute set.org.apache.pulsar.common.policies.data.TransactionBufferStatsgetTransactionBufferStats(boolean lowWaterMarks) org.apache.pulsar.common.policies.data.TransactionBufferStatsgetTransactionBufferStats(boolean lowWaterMarks, boolean segmentStats) org.apache.pulsar.common.policies.data.TransactionInBufferStatsgetTransactionInBufferStats(org.apache.pulsar.client.api.transaction.TxnID txnID) org.apache.pulsar.common.policies.data.TransactionInPendingAckStatsgetTransactionInPendingAckStats(org.apache.pulsar.client.api.transaction.TxnID txnID, String subName) org.apache.pulsar.common.policies.data.TransactionPendingAckStatsgetTransactionPendingAckStats(String subName, boolean lowWaterMarks) protected voidhandleProducerRemoved(Producer producer) protected CompletableFuture<Long>incrementTopicEpoch(Optional<Long> currentEpoch) protected CompletableFuture<Void>booleanisActive(org.apache.pulsar.common.policies.data.InactiveTopicDeleteMode deleteMode) booleanstatic booleanisCompactionSubscription(String subscriptionName) static booleanisDedupCursorName(String name) booleanIndicate if the current topic enabled server side deduplication.booleanbooleanprotected booleanisExceedMaximumDeliveryDelay(io.netty.buffer.ByteBuf headersAndPayload) booleanbooleanisOldestMessageExpired(ManagedCursor cursor, int messageTTLInSeconds) booleanbooleanbooleanbooleanbooleanbooleanprotected booleanbooleanisTxnAborted(org.apache.pulsar.client.api.transaction.TxnID txnID, Position readPosition) onPoliciesUpdate(org.apache.pulsar.common.policies.data.Policies data) voidonUpdate(org.apache.pulsar.common.policies.data.TopicPolicies policies) voidpublishMessage(io.netty.buffer.ByteBuf headersAndPayload, Topic.PublishContext publishContext) voidpublishTxnMessage(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) booleansubscribe(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>voidvoidtriggerOffload(MessageIdImpl messageId) truncate()Truncate a topic.unloadSubscription(String subName) Unload a subscriber.unsubscribe(String subscriptionName) Delete the cursor ledger for a given subscription.voidvoidvoidupdateLastDispatchablePosition(Position position) Update lastDispatchablePosition if the given position is greater than the lastDispatchablePosition.voidupdateRates(NamespaceStats nsStats, org.apache.pulsar.policies.data.loadbalancer.NamespaceBundleStats bundleStats, StatsOutputStream topicStatsStream, ClusterReplicationMetrics replStats, String namespace, boolean hydratePublishers) voidMethods 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, getSystemTopicBytesInCounter, getTopicPublishRateLimiter, getTotalPublishRateLimitCounter, getWaitingProducersCount, handleConsumerAdded, hasLocalProducers, hasSchema, increasePublishLimitedTimes, incrementPublishCount, incrementTopicEpochIfNeeded, internalAddProducer, isClusterMigrationEnabled, isConsumersExceededOnTopic, isDeleteWhileInactive, isEncryptionRequired, isExceedMaximumMessageSize, isProducersExceeded, isProducersExceeded, isProducersExceeded, isSameAddressConsumersExceededOnTopic, isSameAddressProducersExceeded, isSystemCursor, isTransferring, markBatchMessagePublished, recordAddLatency, registerTopicPolicyListener, removeProducer, toString, unregisterTopicPolicyListener, updateBrokerDispatchRate, updateBrokerPublishRate, updateBrokerReplicatorDispatchRate, updateBrokerSubscribeRate, updateBrokerSubscriptionDispatchRate, updateBrokerSubscriptionTypesEnabled, updateEntryFilters, updatePublishRateLimiter, updateResourceGroupLimiter, updateResourceGroupLimiter, updateTopicPolicy, updateTopicPolicyByNamespacePolicyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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
-
DEDUPLICATION_CURSOR_NAME
- See Also:
-
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:
initializein 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:
publishMessagein interfaceTopic
-
updateSubscribeRateLimiter
public void updateSubscribeRateLimiter() -
asyncReadEntry
public void asyncReadEntry(Position position, AsyncCallbacks.ReadEntryCallback callback, Object ctx) -
getPositionAfterN
- Throws:
ManagedLedgerException
-
getFirstPosition
- Throws:
ManagedLedgerException
-
getNumberOfEntries
public long getNumberOfEntries() -
addComplete
- Specified by:
addCompletein interfaceAsyncCallbacks.AddEntryCallback
-
addFailed
- Specified by:
addFailedin interfaceAsyncCallbacks.AddEntryCallback
-
addProducer
public CompletableFuture<Optional<Long>> addProducer(Producer producer, CompletableFuture<Void> producerQueuedFuture) Description copied from interface:TopicTries to add a producer to the topic. Several validations will be performed.- Specified by:
addProducerin interfaceTopic- Overrides:
addProducerin classAbstractTopic- Parameters:
producer- Producer to addproducerQueuedFuture- 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:TopicWait TransactionBuffer recovers completely.- Specified by:
checkIfTransactionBufferRecoverCompletelyin interfaceTopic- Returns:
- a future that will be completed after the transaction buffer recover completely.
-
incrementTopicEpoch
- Specified by:
incrementTopicEpochin classAbstractTopic
-
setTopicEpoch
- Specified by:
setTopicEpochin classAbstractTopic
-
startReplProducers
-
stopReplProducers
-
handleProducerRemoved
- Overrides:
handleProducerRemovedin classAbstractTopic
-
subscribe
Description copied from interface:TopicSubscribe 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:
createSubscriptionin interfaceTopic
-
unsubscribe
Delete the cursor ledger for a given subscription.- Specified by:
unsubscribein 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:
deleteForcefullyin 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:
checkReplicationin interfaceTopic
-
checkMessageExpiry
public void checkMessageExpiry()- Specified by:
checkMessageExpiryin interfaceTopic
-
checkMessageDeduplicationInfo
public void checkMessageDeduplicationInfo()- Specified by:
checkMessageDeduplicationInfoin 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) -
getNumberOfConsumers
public int getNumberOfConsumers()- Specified by:
getNumberOfConsumersin classAbstractTopic
-
getNumberOfSameAddressConsumers
- Specified by:
getNumberOfSameAddressConsumersin classAbstractTopic
-
getSchemaId
- Overrides:
getSchemaIdin classAbstractTopic
-
getSubscriptions
- Specified by:
getSubscriptionsin interfaceTopic
-
getSubscription
- Specified by:
getSubscriptionin interfaceTopic
-
getReplicators
- Specified by:
getReplicatorsin interfaceTopic
-
getShadowReplicators
- Specified by:
getShadowReplicatorsin 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:
updateRatesin 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:
asyncGetStatsin interfaceTopic
-
asyncGetStats
public CompletableFuture<? extends org.apache.pulsar.common.policies.data.stats.TopicStatsImpl> asyncGetStats(GetStatsOptions getStatsOptions) - Specified by:
asyncGetStatsin interfaceTopic
-
deleteSchema
Description copied from interface:TopicDelete the schema if this topic has a schema defined for it.- Specified by:
deleteSchemain interfaceTopic- Overrides:
deleteSchemain classAbstractTopic
-
getInternalStats
public CompletableFuture<org.apache.pulsar.common.policies.data.PersistentTopicInternalStats> getInternalStats(boolean includeLedgerMetadata) - Specified by:
getInternalStatsin interfaceTopic
-
getCompactedTopicContext
-
getCompactedTopicContextAsync
-
getBacklogSize
public long getBacklogSize() -
isActive
public boolean isActive(org.apache.pulsar.common.policies.data.InactiveTopicDeleteMode deleteMode) -
checkClusterMigration
- Specified by:
checkClusterMigrationin interfaceTopic
-
shouldProducerMigrate
public boolean shouldProducerMigrate()- Specified by:
shouldProducerMigratein interfaceTopic
-
isReplicationBacklogExist
public boolean isReplicationBacklogExist()- Specified by:
isReplicationBacklogExistin interfaceTopic
-
checkGC
public void checkGC() -
checkInactiveSubscriptions
public void checkInactiveSubscriptions()- Specified by:
checkInactiveSubscriptionsin interfaceTopic
-
checkInactiveSubscriptions
public void checkInactiveSubscriptions(long expirationTimeMillis) -
checkBackloggedCursors
public void checkBackloggedCursors()Description copied from interface:TopicActivate cursors those caught up backlog-threshold entries and deactivate slow cursors which are creating backlog.- Specified by:
checkBackloggedCursorsin interfaceTopic
-
checkInactiveLedgers
public void checkInactiveLedgers() -
checkCursorsToCacheEntries
public void checkCursorsToCacheEntries()- Specified by:
checkCursorsToCacheEntriesin interfaceTopic
-
checkDeduplicationSnapshot
public void checkDeduplicationSnapshot()- Specified by:
checkDeduplicationSnapshotin interfaceTopic
-
onLocalPoliciesUpdate
-
updateDispatchRateLimiter
public void updateDispatchRateLimiter()- Overrides:
updateDispatchRateLimiterin classAbstractTopic
-
onPoliciesUpdate
public CompletableFuture<Void> onPoliciesUpdate(@Nonnull org.apache.pulsar.common.policies.data.Policies data) - Specified by:
onPoliciesUpdatein interfaceTopic
-
getBacklogQuota
public org.apache.pulsar.common.policies.data.BacklogQuota getBacklogQuota(org.apache.pulsar.common.policies.data.BacklogQuota.BacklogQuotaType backlogQuotaType) - Specified by:
getBacklogQuotain interfaceTopic- Returns:
- Backlog quota for topic
-
checkBacklogQuotaExceeded
public CompletableFuture<Void> checkBacklogQuotaExceeded(String producerName, org.apache.pulsar.common.policies.data.BacklogQuota.BacklogQuotaType backlogQuotaType) - Specified by:
checkBacklogQuotaExceededin 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
-
getBestEffortOldestUnacknowledgedMessageAgeSeconds
public long getBestEffortOldestUnacknowledgedMessageAgeSeconds()Description copied from interface:TopicUses the best-effort (not necessarily up-to-date) information available to return the age.- Specified by:
getBestEffortOldestUnacknowledgedMessageAgeSecondsin interfaceTopic- Returns:
- The oldest unacknowledged message age in seconds, or -1 if not available
-
updateOldPositionInfo
-
checkTimeBacklogExceeded
- Returns:
- determine if backlog quota enforcement needs to be done for topic based on time limit
-
isReplicated
public boolean isReplicated()- Specified by:
isReplicatedin interfaceTopic
-
isShadowReplicated
public boolean isShadowReplicated()- Specified by:
isShadowReplicatedin 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:
getDispatchRateLimiterin interfaceTopic
-
getBrokerDispatchRateLimiter
- Specified by:
getBrokerDispatchRateLimiterin interfaceTopic
-
getSubscribeRateLimiter
- Specified by:
getSubscribeRateLimiterin interfaceTopic
-
getLastPublishedSequenceId
-
getLastPosition
- Specified by:
getLastPositionin interfaceTopic
-
getLastDispatchablePosition
Description copied from interface:TopicGet the last message position that can be dispatch.- Specified by:
getLastDispatchablePositionin interfaceTopic
-
updateLastDispatchablePosition
Update lastDispatchablePosition if the given position is greater than the lastDispatchablePosition.- Parameters:
position-
-
getLastMessageId
- Specified by:
getLastMessageIdin 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:TopicIf 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:
addSchemaIfIdleOrCheckCompatiblein interfaceTopic
-
checkReplicatedSubscriptionControllerState
public void checkReplicatedSubscriptionControllerState() -
getReplicatedSubscriptionController
-
getTopicCompactionService
-
isSystemTopic
public boolean isSystemTopic()- Specified by:
isSystemTopicin interfaceTopic
-
isPersistent
public boolean isPersistent()- Specified by:
isPersistentin 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:TopicPublish Transaction message to this Topic's TransactionBuffer.- Specified by:
publishTxnMessagein 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:TopicEnd the transaction in this topic. -
truncate
Description copied from interface:TopicTruncate 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() -
getDelayedDeliveryMaxDelayInMillis
public long getDelayedDeliveryMaxDelayInMillis() -
getMaxUnackedMessagesOnSubscription
public int getMaxUnackedMessagesOnSubscription() -
isDispatcherPauseOnAckStatePersistentEnabled
public boolean isDispatcherPauseOnAckStatePersistentEnabled() -
updateBrokerDispatchPauseOnAckStatePersistentEnabled
public void updateBrokerDispatchPauseOnAckStatePersistentEnabled()- Overrides:
updateBrokerDispatchPauseOnAckStatePersistentEnabledin classAbstractTopic
-
onUpdate
public void onUpdate(org.apache.pulsar.common.policies.data.TopicPolicies policies) - Specified by:
onUpdatein interfaceTopicPolicyListener
-
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, Position 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:
isTerminatedin classAbstractTopic
-
isMigrated
public boolean isMigrated()- Specified by:
isMigratedin classAbstractTopic
-
isDeduplicationEnabled
public boolean isDeduplicationEnabled()Description copied from interface:TopicIndicate if the current topic enabled server side deduplication. This is a dynamic configuration, user may update it by namespace/topic policies.- Specified by:
isDeduplicationEnabledin interfaceTopic- Returns:
- whether enabled server side deduplication
-
getTransactionInPendingAckStats
public org.apache.pulsar.common.policies.data.TransactionInPendingAckStats getTransactionInPendingAckStats(org.apache.pulsar.client.api.transaction.TxnID txnID, String subName) -
getPendingAckManagedLedger
-
getShadowSourceTopic
-
isExceedMaximumDeliveryDelay
protected boolean isExceedMaximumDeliveryDelay(io.netty.buffer.ByteBuf headersAndPayload) -
getTopicAttributes
Description copied from interface:TopicGet OpenTelemetry attribute set.- Specified by:
getTopicAttributesin interfaceTopic- Returns:
-