sijie commented on a change in pull request #531: Issue-530 BP-14 BP-14 Relax 
Durability - protocol changes preview
URL: https://github.com/apache/bookkeeper/pull/531#discussion_r142499213
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerMetadata.java
 ##########
 @@ -422,6 +427,18 @@ public static LedgerMetadata parseConfig(byte[] bytes, 
Version version, Optional
         } else {
             lc.ackQuorumSize = lc.writeQuorumSize;
         }
+        if (data.hasLedgerType()) {
+            switch (data.getLedgerType()) {
+                case VD_JOURNAL:
+                   lc.ledgerType = LedgerType.VD_JOURNAL;
+                   break;
+                case PD_JOURNAL:
+                   lc.ledgerType = LedgerType.PD_JOURNAL;
+                   break;
+                default:
+                    throw new IllegalStateException("illegal ledgerType 
"+data.getLedgerType()+" is metadata");
 
 Review comment:
   please throw IOException instead of IllegalStateException. because this 
means the metadata is corrupted or unknown.
 
----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to