[1/2] curator git commit: CURATOR-360 - Allow Zookeeper servers in TestingCluster to listen on network interfaces other than localhost
Repository: curator Updated Branches: refs/heads/CURATOR-3.0 60d24c2c9 -> e6ed99965 CURATOR-360 - Allow Zookeeper servers in TestingCluster to listen on network interfaces other than localhost Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/0a0a1e7d Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/0a0a1e7d Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/0a0a1e7d Branch: refs/heads/CURATOR-3.0 Commit: 0a0a1e7d8beac27cd07dd0f445e55e9c6646e10c Parents: ee5d654 Author: ImeshaAuthored: Wed Nov 30 05:25:24 2016 +0530 Committer: Imesha Committed: Wed Nov 30 05:25:24 2016 +0530 -- .../org/apache/curator/test/InstanceSpec.java | 34 +--- .../curator/test/QuorumConfigBuilder.java | 2 +- 2 files changed, 30 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/0a0a1e7d/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java -- diff --git a/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java b/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java index 32b1738..bc0272c 100644 --- a/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java +++ b/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java @@ -72,6 +72,7 @@ public class InstanceSpec private final int tickTime; private final int maxClientCnxns; private final Map customProperties; +private final String hostname; public static InstanceSpec newInstanceSpec() { @@ -116,7 +117,7 @@ public class InstanceSpec */ public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId) { -this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, -1, -1, null); +this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, -1, -1, null, null); } /** @@ -130,7 +131,7 @@ public class InstanceSpec * @param maxClientCnxns max number of client connections from the same IP. Set -1 to use default server configuration */ public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns) { -this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, tickTime, maxClientCnxns, null); +this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, tickTime, maxClientCnxns, null, null); } /** @@ -146,6 +147,23 @@ public class InstanceSpec */ public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns, Map customProperties) { +this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, tickTime, maxClientCnxns, customProperties, null); +} + +/** + * @param dataDirectory where to store data/logs/etc. + * @param port the port to listen on - each server in the ensemble must use a unique port + * @param electionPort the electionPort to listen on - each server in the ensemble must use a unique electionPort + * @param quorumPort the quorumPort to listen on - each server in the ensemble must use a unique quorumPort + * @param deleteDataDirectoryOnClose if true, the data directory will be deleted when {@link TestingCluster#close()} is called + * @param serverId the server ID for the instance + * @param tickTime tickTime. Set -1 to used fault server configuration + * @param maxClientCnxns max number of client connections from the same IP. Set -1 to use default server configuration + * @param customProperties other properties to be passed to the server + * @param hostname Hostname or IP if the cluster is intending to be bounded into external interfaces + */ +public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns, Map customProperties,String hostname) +{ this.dataDirectory = (dataDirectory != null) ? dataDirectory : Files.createTempDir(); this.port = (port >= 0) ? port : getRandomPort(); this.electionPort = (electionPort >= 0) ? electionPort
curator git commit: CURATOR-360 - Allow Zookeeper servers in TestingCluster to listen on network interfaces other than localhost
Repository: curator Updated Branches: refs/heads/master ee5d65463 -> 0a0a1e7d8 CURATOR-360 - Allow Zookeeper servers in TestingCluster to listen on network interfaces other than localhost Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/0a0a1e7d Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/0a0a1e7d Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/0a0a1e7d Branch: refs/heads/master Commit: 0a0a1e7d8beac27cd07dd0f445e55e9c6646e10c Parents: ee5d654 Author: ImeshaAuthored: Wed Nov 30 05:25:24 2016 +0530 Committer: Imesha Committed: Wed Nov 30 05:25:24 2016 +0530 -- .../org/apache/curator/test/InstanceSpec.java | 34 +--- .../curator/test/QuorumConfigBuilder.java | 2 +- 2 files changed, 30 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/0a0a1e7d/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java -- diff --git a/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java b/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java index 32b1738..bc0272c 100644 --- a/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java +++ b/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java @@ -72,6 +72,7 @@ public class InstanceSpec private final int tickTime; private final int maxClientCnxns; private final Map customProperties; +private final String hostname; public static InstanceSpec newInstanceSpec() { @@ -116,7 +117,7 @@ public class InstanceSpec */ public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId) { -this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, -1, -1, null); +this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, -1, -1, null, null); } /** @@ -130,7 +131,7 @@ public class InstanceSpec * @param maxClientCnxns max number of client connections from the same IP. Set -1 to use default server configuration */ public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns) { -this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, tickTime, maxClientCnxns, null); +this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, tickTime, maxClientCnxns, null, null); } /** @@ -146,6 +147,23 @@ public class InstanceSpec */ public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns, Map customProperties) { +this(dataDirectory, port, electionPort, quorumPort, deleteDataDirectoryOnClose, serverId, tickTime, maxClientCnxns, customProperties, null); +} + +/** + * @param dataDirectory where to store data/logs/etc. + * @param port the port to listen on - each server in the ensemble must use a unique port + * @param electionPort the electionPort to listen on - each server in the ensemble must use a unique electionPort + * @param quorumPort the quorumPort to listen on - each server in the ensemble must use a unique quorumPort + * @param deleteDataDirectoryOnClose if true, the data directory will be deleted when {@link TestingCluster#close()} is called + * @param serverId the server ID for the instance + * @param tickTime tickTime. Set -1 to used fault server configuration + * @param maxClientCnxns max number of client connections from the same IP. Set -1 to use default server configuration + * @param customProperties other properties to be passed to the server + * @param hostname Hostname or IP if the cluster is intending to be bounded into external interfaces + */ +public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns, Map customProperties,String hostname) +{ this.dataDirectory = (dataDirectory != null) ? dataDirectory : Files.createTempDir(); this.port = (port >= 0) ? port : getRandomPort(); this.electionPort = (electionPort >= 0) ? electionPort :