You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/10/04 16:58:58 UTC

[GitHub] merlimat closed pull request #2718: Allow bk-client to support old bk-protocol

merlimat closed pull request #2718: Allow bk-client to support old bk-protocol
URL: https://github.com/apache/pulsar/pull/2718
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/conf/broker.conf b/conf/broker.conf
index 2277cc8167..f4a57b6b03 100644
--- a/conf/broker.conf
+++ b/conf/broker.conf
@@ -289,6 +289,9 @@ bookkeeperClientTimeoutInSeconds=30
 # Using a value of 0, is disabling the speculative reads
 bookkeeperClientSpeculativeReadTimeoutInMillis=0
 
+# Use older Bookkeeper wire protocol with bookie
+bookkeeperUseV2WireProtocol=true
+
 # Enable bookies health check. Bookies that have more than the configured number of failure within
 # the interval will be quarantined for some time. During this period, new ledgers won't be created
 # on these bookies
diff --git a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
index 84cc569cb8..e436ff43ae 100644
--- a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
+++ b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
@@ -286,6 +286,8 @@
     // Speculative reads are initiated if a read request doesn't complete within
     // a certain time Using a value of 0, is disabling the speculative reads
     private int bookkeeperClientSpeculativeReadTimeoutInMillis = 0;
+    // Use older Bookkeeper wire protocol with bookie
+    private boolean bookkeeperUseV2WireProtocol = true;
     // Enable bookies health check. Bookies that have more than the configured
     // number of failure within the interval will be quarantined for some time.
     // During this period, new ledgers won't be created on these bookies
@@ -1097,6 +1099,14 @@ public void setBookkeeperClientSpeculativeReadTimeoutInMillis(int bookkeeperClie
         this.bookkeeperClientSpeculativeReadTimeoutInMillis = bookkeeperClientSpeculativeReadTimeoutInMillis;
     }
 
+    public boolean isBookkeeperUseV2WireProtocol() {
+        return bookkeeperUseV2WireProtocol;
+    }
+
+    public void setBookkeeperUseV2WireProtocol(boolean bookkeeperUseV2WireProtocol) {
+        this.bookkeeperUseV2WireProtocol = bookkeeperUseV2WireProtocol;
+    }
+
     public boolean isBookkeeperClientHealthCheckEnabled() {
         return bookkeeperClientHealthCheckEnabled;
     }
diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/BookKeeperClientFactoryImpl.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/BookKeeperClientFactoryImpl.java
index c1218540b2..2231f97512 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/BookKeeperClientFactoryImpl.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/BookKeeperClientFactoryImpl.java
@@ -53,7 +53,7 @@ public BookKeeper create(ServiceConfiguration conf, ZooKeeper zkClient) throws I
         bkConf.setReadEntryTimeout((int) conf.getBookkeeperClientTimeoutInSeconds());
         bkConf.setSpeculativeReadTimeout(conf.getBookkeeperClientSpeculativeReadTimeoutInMillis());
         bkConf.setNumChannelsPerBookie(16);
-        bkConf.setUseV2WireProtocol(true);
+        bkConf.setUseV2WireProtocol(conf.isBookkeeperUseV2WireProtocol());
         bkConf.setEnableDigestTypeAutodetection(true);
         bkConf.setLedgerManagerFactoryClassName(HierarchicalLedgerManagerFactory.class.getName());
         if (conf.isBookkeeperClientHealthCheckEnabled()) {


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services