lhotari commented on code in PR #23832:
URL: https://github.com/apache/pulsar/pull/23832#discussion_r1910044930
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:
##########
@@ -1522,21 +1522,18 @@ protected void
internalGetPartitionedStats(AsyncResponse asyncResponse, boolean
}
}
if (perPartition && stats.partitions.isEmpty()) {
- try {
- boolean pathExists =
namespaceResources().getPartitionedTopicResources()
- .partitionedTopicExists(topicName);
- if (pathExists) {
- stats.partitions.put(topicName.toString(), new
TopicStatsImpl());
- } else {
- asyncResponse.resume(
- new RestException(Status.NOT_FOUND,
- "Internal topics have not been
generated yet"));
- return null;
- }
- } catch (Exception e) {
- asyncResponse.resume(new RestException(e));
- return null;
- }
+ return namespaceResources().getPartitionedTopicResources()
+ .partitionedTopicExistsAsync(topicName).
+ thenAccept(exists -> {
+ if (exists) {
+ stats.partitions.put(topicName.toString(),
new TopicStatsImpl());
+ asyncResponse.resume(stats);
+ } else {
+ asyncResponse.resume(
+ new RestException(Status.NOT_FOUND,
+ "Internal topics have not
been generated yet"));
+ }
+ });
Review Comment:
I meant a different thing. The return on line 1525 should be removed and
instead there should be a `return null;` after that expression.
--
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]