liudezhi2098 commented on a change in pull request #13880:
URL: https://github.com/apache/pulsar/pull/13880#discussion_r789609010



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
##########
@@ -3445,6 +3465,68 @@ private void 
internalExpireMessagesByTimestampForSinglePartition(String subName,
         }
     }
 
+    private CompletableFuture<Void> 
internalExpireMessagesByTimestampForSinglePartitionAsyn(
+            PartitionedTopicMetadata partitionMetadata, String subName, int 
expireTimeInSeconds,
+            boolean authoritative) {
+        if (!topicName.isPartitioned() && partitionMetadata.partitions > 0) {
+            String msg = "This method should not be called for partitioned 
topic";
+            log.error("[{}] {} {} {}", clientAppId(), msg, topicName, subName);
+            return FutureUtil.failedFuture(new IllegalStateException(msg));
+        } else {
+            return validateTopicOwnershipAsync(topicName, authoritative)
+                    .thenCompose(unused -> 
validateTopicOperationAsync(topicName, TopicOperation.EXPIRE_MESSAGES))
+                    .thenAccept(unused -> 
getTopicReferenceAsync(topicName).thenAccept(t -> {

Review comment:
       handled by the caller




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to