hangc0276 commented on code in PR #4095:
URL: https://github.com/apache/bookkeeper/pull/4095#discussion_r1372732024


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManagerFactory.java:
##########
@@ -62,9 +62,11 @@ public void format(AbstractConfiguration<?> conf, 
LayoutManager layoutManager)
 
         Class<? extends LedgerManagerFactory> factoryClass;
         try {
-            factoryClass = conf.getLedgerManagerFactoryClass();
-        } catch (ConfigurationException e) {
-            throw new IOException("Failed to get ledger manager factory class 
from configuration : ", e);
+            factoryClass = (Class<? extends LedgerManagerFactory>)
+                    
Class.forName(layoutManager.readLedgerLayout().getManagerFactoryClass());
+        } catch (ClassNotFoundException e) {
+            // should not reach here, as LayoutManager was successfully inited
+            throw new IOException("Failed to read ledger manager factory class 
from LAYOUT : ", e);
         }
 
         layoutManager.deleteLedgerLayout();

Review Comment:
   The LAYOUT is `HierarchicalLedgerManager` but the user configuration is 
`LongHierarchicalLedgerManagerFactory`, I think we should fail the format. 
Otherwise, the user may think the LAYOUT  has been formatted to 
`LongHierarchicalLedgerManagerFactory`, but actually it doesn't



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