aparajita89 commented on a change in pull request #14102:
URL: https://github.com/apache/pulsar/pull/14102#discussion_r806481407



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryService.java
##########
@@ -42,19 +43,26 @@
         return checkers;
     }
 
-    static SchemaRegistryService create(SchemaStorage schemaStorage, 
Set<String> schemaRegistryCompatibilityCheckers) {
+    static SchemaRegistryService create(String schemaRegistryClassName, 
SchemaStorage schemaStorage,
+          Set<String> schemaRegistryCompatibilityCheckers) {
         if (schemaStorage != null) {
             try {
                 Map<SchemaType, SchemaCompatibilityCheck> checkers = 
getCheckers(schemaRegistryCompatibilityCheckers);
                 checkers.put(SchemaType.KEY_VALUE, new 
KeyValueSchemaCompatibilityCheck(checkers));
-                return SchemaRegistryServiceWithSchemaDataValidator.of(
-                        new SchemaRegistryServiceImpl(schemaStorage, 
checkers));
+
+                SchemaRegistryService schemaRegistryService = 
(SchemaRegistryService) Class
+                      
.forName(schemaRegistryClassName).getDeclaredConstructor(SchemaStorage.class, 
Map.class)
+                      .newInstance(schemaStorage, checkers);
+
+                return 
SchemaRegistryServiceWithSchemaDataValidator.of(schemaRegistryService);
             } catch (Exception e) {
                 LOG.warn("Unable to create schema registry storage, defaulting 
to empty storage", e);
             }
         }
         return new DefaultSchemaRegistryService();
     }
 
+    void initialize(ServiceConfiguration configuration);

Review comment:
       this would be needed in custom implementations of the schema registry 
where additional configs are required which are specific to the custom 
implementation. for example, we require a custom schema registry which needs to 
make HTTP calls to another service. configs specific to the schema registry, 
like the service endpoint, needs to be passed via ServiceConfiguration and set 
in the schema registry using this initialize method. this is the same 
convention being followed for other configs such as authorization provider as 
well.




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