nodece commented on a change in pull request #13297:
URL: https://github.com/apache/pulsar/pull/13297#discussion_r794298013



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
##########
@@ -4805,4 +4806,30 @@ private void 
internalGetReplicatedSubscriptionStatusForNonPartitionedTopic(Async
             resumeAsyncResponseExceptionally(asyncResponse, e);
         }
     }
+
+    protected CompletableFuture<SchemaCompatibilityStrategy> 
internalGetSchemaCompatibilityStrategy(boolean applied) {
+        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;
+                }));
+    }
+
+    protected CompletableFuture<Void> 
internalSetSchemaCompatibilityStrategy(SchemaCompatibilityStrategy strategy) {
+        validateTopicOperation(topicName, 
TopicOperation.SET_SCHEMA_COMPATIBILITY_STRATEGY);

Review comment:
       Good catch




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