codelipenghui commented on a change in pull request #13880:
URL: https://github.com/apache/pulsar/pull/13880#discussion_r789559152
##########
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:
Missed exception handling
##########
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(
Review comment:
```suggestion
private CompletableFuture<Void>
internalExpireMessagesByTimestampForSinglePartitionAsync(
```
--
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]