sijie commented on a change in pull request #1127: BP-29 (task 1) : Introduce 
`metadataServiceUrl`
URL: https://github.com/apache/bookkeeper/pull/1127#discussion_r166904525
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/AbstractConfiguration.java
 ##########
 @@ -175,6 +179,58 @@ public void loadConf(CompositeConfiguration baseConf) {
         }
     }
 
+    /**
+     * Get metadata service uri.
+     *
+     * @return metadata service uri.
+     */
+    @SuppressWarnings("deprecation")
+    public String getMetadataServiceUri() throws ConfigurationException {
+        String serviceUri = getString(METADATA_SERVICE_URI);
+        if (null == serviceUri) {
+            // no service uri is defined, fallback to old settings
+            String ledgerManagerType;
+            Class<? extends LedgerManagerFactory> factoryClass = 
getLedgerManagerFactoryClass();
+            if (factoryClass == null) {
+                ledgerManagerType = HierarchicalLedgerManagerFactory.NAME;
+            } else {
+                if 
(!AbstractZkLedgerManagerFactory.class.isAssignableFrom(factoryClass)) {
+                    // this is a non-zk implementation
+                    throw new UnsupportedOperationException("metadata service 
uri is not supported for "
 
 Review comment:
   the idea was: in the case no service uri is defined, if there is a 
customized factory class implemented, we should fail it and force the users to 
define a metadata service uri for this factory implementation. so from this 
perspective, it is a unsupported operation exception.
   
   but if you have a better idea on what exception we should throw here, please 
help suggest one.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to