You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2018/10/04 16:59:06 UTC
[pulsar] branch master updated: Allow bk-client to support old
bk-protocol (#2718)
This is an automated email from the ASF dual-hosted git repository.
mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 24749e1 Allow bk-client to support old bk-protocol (#2718)
24749e1 is described below
commit 24749e16bdb1e3a4f9891713834c2be0792f786f
Author: Rajan Dhabalia <rd...@apache.org>
AuthorDate: Thu Oct 4 09:58:56 2018 -0700
Allow bk-client to support old bk-protocol (#2718)
---
conf/broker.conf | 3 +++
.../java/org/apache/pulsar/broker/ServiceConfiguration.java | 10 ++++++++++
.../org/apache/pulsar/broker/BookKeeperClientFactoryImpl.java | 2 +-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/conf/broker.conf b/conf/broker.conf
index 2277cc8..f4a57b6 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 84cc569..e436ff4 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 @@ public class ServiceConfiguration implements PulsarConfiguration {
// 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 class ServiceConfiguration implements PulsarConfiguration {
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 c121854..2231f97 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 class BookKeeperClientFactoryImpl implements BookKeeperClientFactory {
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()) {