[GitHub] [pulsar] merlimat commented on a diff in pull request #19208: [improve][broker]Enable custom metadata stores

2023-01-15 Thread GitBox


merlimat commented on code in PR #19208:
URL: https://github.com/apache/pulsar/pull/19208#discussion_r1070641969


##
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/MetadataStoreFactoryImpl.java:
##
@@ -45,19 +62,50 @@ public static MetadataStoreExtended createExtended(String 
metadataURL, MetadataS
 private static MetadataStore newInstance(String metadataURL, 
MetadataStoreConfig metadataStoreConfig,
  boolean enableSessionWatcher)
 throws MetadataStoreException {
+MetadataStoreProvider provider = findProvider(metadataURL);
+if (provider != null) {
+return provider.create(metadataURL, metadataStoreConfig, 
enableSessionWatcher);
+}
+return new ZKMetadataStore(metadataURL, metadataStoreConfig, 
enableSessionWatcher);
+}
+
+static void loadProviders() {
+String factoryClasses = 
System.getProperty(METADATASTORE_PROVIDERS_PROPERTY);

Review Comment:
   This config needs to be loaded from many places, CLI tools to make it less 
practical to add the config option everywhere. We also need it in BookKeeper 
process and tools, where we have cannot add Pulsar's specific configs.



-- 
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: commits-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [pulsar] merlimat commented on a diff in pull request #19208: [improve][broker]Enable custom metadata stores

2023-01-12 Thread GitBox


merlimat commented on code in PR #19208:
URL: https://github.com/apache/pulsar/pull/19208#discussion_r1068389656


##
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/MetadataStoreFactoryImpl.java:
##
@@ -78,6 +123,8 @@ public static String removeIdentifierFromMetadataURL(String 
metadataURL) {
 return 
metadataURL.substring(EtcdMetadataStore.ETCD_SCHEME_IDENTIFIER.length());
 } else if 
(metadataURL.startsWith(ZKMetadataStore.ZK_SCHEME_IDENTIFIER)) {
 return 
metadataURL.substring(ZKMetadataStore.ZK_SCHEME_IDENTIFIER.length());
+} else if ((provider = findProvider(metadataURL)) != null) {

Review Comment:
   We could also have the `MetadataStoreProvider` for the existing 
implementations and in `loadProviders()` we always go through the list of 
builtin providers as well what is specified in the property.



-- 
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: commits-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org