[2/2] curator git commit: Merge branch 'master' into CURATOR-3.0

2016-12-04 Thread cammckenzie
Merge branch 'master' into CURATOR-3.0

Conflicts:

curator-test/src/main/java/org/apache/curator/test/QuorumConfigBuilder.java


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/e6ed9996
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/e6ed9996
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/e6ed9996

Branch: refs/heads/CURATOR-3.0
Commit: e6ed99965b6df91607b2505a3784780e51fa8c53
Parents: 60d24c2 0a0a1e7
Author: Cam McKenzie 
Authored: Mon Dec 5 13:05:07 2016 +1100
Committer: Cam McKenzie 
Committed: Mon Dec 5 13:05:07 2016 +1100

--
 .../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/e6ed9996/curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java
--
diff --cc curator-test/src/main/java/org/apache/curator/test/InstanceSpec.java
index 0a71161,bc0272c..d04e09f
--- 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,11 -72,8 +72,12 @@@ public class InstanceSpe
  private final int tickTime;
  private final int maxClientCnxns;
  private final Map customProperties;
+ private final String hostname;
  
 +public static void reset() {
 +nextServerId.set(1);
 +}
 +
  public static InstanceSpec newInstanceSpec()
  {
  return new InstanceSpec(null, -1, -1, -1, true, -1, -1, -1);

http://git-wip-us.apache.org/repos/asf/curator/blob/e6ed9996/curator-test/src/main/java/org/apache/curator/test/QuorumConfigBuilder.java
--
diff --cc 
curator-test/src/main/java/org/apache/curator/test/QuorumConfigBuilder.java
index 5baf5ce,fb4039d..d385103
--- 
a/curator-test/src/main/java/org/apache/curator/test/QuorumConfigBuilder.java
+++ 
b/curator-test/src/main/java/org/apache/curator/test/QuorumConfigBuilder.java
@@@ -124,7 -100,7 +124,7 @@@ public class QuorumConfigBuilder implem
  {
  for ( InstanceSpec thisSpec : instanceSpecs )
  {
- properties.setProperty("server." + thisSpec.getServerId(), 
String.format("localhost:%d:%d;localhost:%d", thisSpec.getQuorumPort(), 
thisSpec.getElectionPort(), thisSpec.getPort()));
 -properties.setProperty("server." + thisSpec.getServerId(), 
String.format("%s:%d:%d", thisSpec.getHostname(), thisSpec.getQuorumPort(), 
thisSpec.getElectionPort()));
++properties.setProperty("server." + thisSpec.getServerId(), 
String.format("%s:%d:%d;%s:%d", thisSpec.getHostname(), 
thisSpec.getQuorumPort(), thisSpec.getElectionPort(), thisSpec.getHostname(), 
thisSpec.getPort()));
  }
  }
  Map customProperties = spec.getCustomProperties();



[1/2] curator git commit: CURATOR-360 - Allow Zookeeper servers in TestingCluster to listen on network interfaces other than localhost

2016-12-04 Thread cammckenzie
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: Imesha 
Authored: 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

2016-12-04 Thread cammckenzie
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: Imesha 
Authored: 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 :