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_r147734359
 
 

 ##########
 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) {
+                LOG.error("invalid writeQuorumSize {} != ensembleSize {} for 
FORCE_DEFERRED_ON_JOURNAL ledger. Striping is not allowed",
+                    builderWriteQuorumSize, builderEnsembleSize);
 
 Review comment:
   I think that in the latest discussions and the latest version of the 
document we decided to send force requests to all of the bookies. So actually 
there should be no problem with striping.
   
   @sijie  @ivankelly

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