AnonHxy commented on code in PR #16946:
URL: https://github.com/apache/pulsar/pull/16946#discussion_r969078098


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:
##########
@@ -5250,42 +5258,42 @@ protected void 
internalGetReplicatedSubscriptionStatus(AsyncResponse asyncRespon
         });
     }
 
+    private CompletableFuture<Map<String, Boolean>> 
getReplicatedSubscriptionStatusFromLocalBroker(
+            TopicName localTopicName,
+            String subName) {
+        return getTopicReferenceAsync(localTopicName).thenCompose(topic -> {
+            Subscription sub = topic.getSubscription(subName);
+            if (sub == null) {
+                return FutureUtil.failedFuture(new 
RestException(Status.NOT_FOUND,
+                    getSubNotFoundErrorMessage(localTopicName.toString(), 
subName)));
+            }
+            if (topic instanceof PersistentTopic && sub instanceof 
PersistentSubscription) {
+                Map<String, Boolean> res = Maps.newHashMap();
+                res.put(localTopicName.toString(), sub.isReplicated());
+                return CompletableFuture.completedFuture(res);

Review Comment:
   Update and added UT



-- 
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