You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by eo...@apache.org on 2020/06/19 07:55:45 UTC

[zookeeper] branch branch-3.6 updated: ZOOKEEPER-3865: fix backward-compatibility for ZooKeeperServer constructor

This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch branch-3.6
in repository https://gitbox.apache.org/repos/asf/zookeeper.git


The following commit(s) were added to refs/heads/branch-3.6 by this push:
     new 9d0e374  ZOOKEEPER-3865: fix backward-compatibility for ZooKeeperServer constructor
9d0e374 is described below

commit 9d0e3742ad7420ab81480a70113dea457564398f
Author: Mate Szalay-Beko <sy...@apache.org>
AuthorDate: Fri Jun 19 09:55:12 2020 +0200

    ZOOKEEPER-3865: fix backward-compatibility for ZooKeeperServer constructor
    
    In the fix of ZOOKEEPER-3829 I accidentally changed a public constructor of ZooKeeper server. I didn’t realize Curator is using it for testing (and maybe other Apache projects are doing so as well).
    
    In this PR I restore the original constructor for master and branch-3.6.
    
    For branch-3.5 I will submit an other PR, that will make it compatible with e.g. Curator 4.3.
    
    Author: Mate Szalay-Beko <sy...@apache.org>
    
    Reviewers: Enrico Olivelli <eo...@apache.org>
    
    Closes #1382 from symat/ZOOKEEPER-3865
    
    (cherry picked from commit f6c9bac7d39e790171762e522fedb7b3af66d3c7)
    Signed-off-by: Enrico Olivelli <eo...@apache.org>
---
 .../main/java/org/apache/zookeeper/server/ZooKeeperServer.java   | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java
index 8662a9b..d1365e4 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java
@@ -298,7 +298,14 @@ public class ZooKeeperServer implements SessionExpirer, ServerStats.Provider {
     }
 
     /**
-     * Creates a ZooKeeperServer instance. It sets everything up, but doesn't
+     * Keeping this constructor for backward compatibility
+     */
+    public ZooKeeperServer(FileTxnSnapLog txnLogFactory, int tickTime, int minSessionTimeout, int maxSessionTimeout, int clientPortListenBacklog, ZKDatabase zkDb, String initialConfig) {
+        this(txnLogFactory, tickTime, minSessionTimeout, maxSessionTimeout, clientPortListenBacklog, zkDb, initialConfig, QuorumPeerConfig.isReconfigEnabled());
+    }
+
+    /**
+     *  * Creates a ZooKeeperServer instance. It sets everything up, but doesn't
      * actually start listening for clients until run() is invoked.
      *
      */