eolivelli commented on a change in pull request #670: BP-14 Relax Durability - 
patch 1 Introducing LedgerType
URL: https://github.com/apache/bookkeeper/pull/670#discussion_r147739338
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerCreateOp.java
 ##########
 @@ -261,15 +269,36 @@ public CreateBuilder 
withDigestType(org.apache.bookkeeper.client.api.DigestType
         }
 
         @Override
+        public CreateBuilder withLedgerType(LedgerType ledgerType) {
+            this.builderLedgerType = ledgerType;
+            return this;
+        }
+
+        @Override
         public CreateAdvBuilder makeAdv() {
             return new CreateAdvBuilderImpl(this);
         }
 
         private boolean validate() {
+            if (builderLedgerType == null) {
+                LOG.error("invalid null builderLedgerType");
+                return false;
+            }
+
+            if (bk.getConf().getUseV2WireProtocol() && builderLedgerType != 
LedgerType.FORCE_ON_JOURNAL) {
+                LOG.error("invalid builderLedgerType {} while using v2 wire 
protocol");
+                return false;
+            }
+
             if (builderWriteQuorumSize > builderEnsembleSize) {
                 LOG.error("invalid writeQuorumSize {} > ensembleSize {}", 
builderWriteQuorumSize, builderEnsembleSize);
                 return false;
             }
+            if (builderLedgerType.equals(LedgerType.FORCE_DEFERRED_ON_JOURNAL) 
&& builderWriteQuorumSize != builderEnsembleSize) {
 
 Review comment:
   @sijie  I think I have addressed this one, the link is broken with a rebase

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