瀏覽代碼

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 年之前
父節點
當前提交
ebc9340426
共有 2 個文件被更改,包括 10 次插入0 次删除
  1. 3 0
      CHANGES.txt
  2. 7 0
      src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java

+ 3 - 0
CHANGES.txt

@@ -437,6 +437,9 @@ IMPROVEMENTS:
   ZOOKEEPER-1584. Adding mvn-install target for deploying the
   ZOOKEEPER-1584. Adding mvn-install target for deploying the
   zookeeper artifacts to .m2 repository (Ashish Singh via phunt)
   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 - 
 Release 3.4.0 - 
 
 
 Non-backward compatible changes:
 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.io.IOException;
 import java.net.InetAddress;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.net.InetSocketAddress;
+import java.util.Collections;
+import java.util.Map;
 import java.util.Properties;
 import java.util.Properties;
 import java.util.Map.Entry;
 import java.util.Map.Entry;
 
 
@@ -488,6 +490,11 @@ public class QuorumPeerConfig {
         return quorumVerifier;
         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 long getServerId() { return serverId; }
 
 
     public boolean isDistributed() { return (quorumVerifier!=null && quorumVerifier.getVotingMembers().size() > 1); }
     public boolean isDistributed() { return (quorumVerifier!=null && quorumVerifier.getVotingMembers().size() > 1); }