Jason918 commented on a change in pull request #14061:
URL: https://github.com/apache/pulsar/pull/14061#discussion_r795303818



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
##########
@@ -4826,25 +4826,25 @@ private void 
internalGetReplicatedSubscriptionStatusForNonPartitionedTopic(Async
         if (applied) {
             return getSchemaCompatibilityStrategyAsync();
         }
-        return validateTopicOperationAsync(topicName, 
TopicOperation.GET_SCHEMA_COMPATIBILITY_STRATEGY)
-                .thenCompose(n -> 
getTopicPoliciesAsyncWithRetry(topicName).thenApply(op -> {
-                    if (!op.isPresent()) {
-                        return null;
-                    }
-                    SchemaCompatibilityStrategy strategy = 
op.get().getSchemaCompatibilityStrategy();
-                    return SchemaCompatibilityStrategy.isUndefined(strategy) ? 
null : strategy;
-                }));
+        validateTopicPolicyOperation(topicName, 
PolicyName.SCHEMA_COMPATIBILITY_STRATEGY, PolicyOperation.READ);

Review comment:
       Same here.

##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java
##########
@@ -766,39 +768,37 @@ protected void 
resumeAsyncResponseExceptionally(AsyncResponse asyncResponse, Thr
     }
 
     protected CompletableFuture<SchemaCompatibilityStrategy> 
getSchemaCompatibilityStrategyAsync() {
-        return validateTopicOperationAsync(topicName, 
TopicOperation.GET_SCHEMA_COMPATIBILITY_STRATEGY)
-                .thenCompose((__) -> {
-                    CompletableFuture<SchemaCompatibilityStrategy> future;
-                    if (config().isTopicLevelPoliciesEnabled()) {
-                        future = getTopicPoliciesAsyncWithRetry(topicName)
-                                .thenApply(op -> 
op.map(TopicPolicies::getSchemaCompatibilityStrategy).orElse(null));
-                    } else {
-                        future = CompletableFuture.completedFuture(null);
-                    }
+        validateTopicPolicyOperation(topicName, 
PolicyName.SCHEMA_COMPATIBILITY_STRATEGY, PolicyOperation.READ);

Review comment:
       This is blocking method. Please use `validateTopicPolicyOperationAsync`.




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