Prechádzať zdrojové kódy

ZOOKEEPER-1602. a change to QuorumPeerConfig's API broke compatibility with HBase (Alexander Shraer via phunt)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1422473 13f79535-47bb-0310-9956-ffa450edef68
Patrick D. Hunt 12 rokov pred
rodič
commit
ebc9340426

+ 3 - 0
CHANGES.txt

@@ -437,6 +437,9 @@ IMPROVEMENTS:
   ZOOKEEPER-1584. Adding mvn-install target for deploying the
   zookeeper artifacts to .m2 repository (Ashish Singh via phunt)
 
+  ZOOKEEPER-1602. a change to QuorumPeerConfig's API broke
+  compatibility with HBase (Alexander Shraer via phunt)
+
 Release 3.4.0 - 
 
 Non-backward compatible changes:

+ 7 - 0
src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java

@@ -28,6 +28,8 @@ import java.io.FileWriter;
 import java.io.IOException;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
+import java.util.Collections;
+import java.util.Map;
 import java.util.Properties;
 import java.util.Map.Entry;
 
@@ -488,6 +490,11 @@ public class QuorumPeerConfig {
         return quorumVerifier;
     }
 
+    public Map<Long,QuorumServer> getServers() {
+        // returns all configuration servers -- participants and observers
+        return Collections.unmodifiableMap(quorumVerifier.getAllMembers());
+    }
+
     public long getServerId() { return serverId; }
 
     public boolean isDistributed() { return (quorumVerifier!=null && quorumVerifier.getVotingMembers().size() > 1); }