|
@@ -442,12 +442,7 @@ public class ZooKeeper implements AutoCloseable {
|
|
* @throws IOException
|
|
* @throws IOException
|
|
* in cases of network failure
|
|
* in cases of network failure
|
|
* @throws IllegalArgumentException
|
|
* @throws IllegalArgumentException
|
|
- * if any of the following is true:
|
|
|
|
- * <ul>
|
|
|
|
- * <li> if an invalid chroot path is specified
|
|
|
|
- * <li> for an invalid list of ZooKeeper hosts
|
|
|
|
- * <li> watcher is null
|
|
|
|
- * </ul>
|
|
|
|
|
|
+ * if an invalid chroot path is specified
|
|
*/
|
|
*/
|
|
public ZooKeeper(String connectString, int sessionTimeout, Watcher watcher) throws IOException {
|
|
public ZooKeeper(String connectString, int sessionTimeout, Watcher watcher) throws IOException {
|
|
this(connectString, sessionTimeout, watcher, false);
|
|
this(connectString, sessionTimeout, watcher, false);
|
|
@@ -496,12 +491,7 @@ public class ZooKeeper implements AutoCloseable {
|
|
* @throws IOException
|
|
* @throws IOException
|
|
* in cases of network failure
|
|
* in cases of network failure
|
|
* @throws IllegalArgumentException
|
|
* @throws IllegalArgumentException
|
|
- * if any of the following is true:
|
|
|
|
- * <ul>
|
|
|
|
- * <li> if an invalid chroot path is specified
|
|
|
|
- * <li> for an invalid list of ZooKeeper hosts
|
|
|
|
- * <li> watcher is null
|
|
|
|
- * </ul>
|
|
|
|
|
|
+ * if an invalid chroot path is specified
|
|
*/
|
|
*/
|
|
public ZooKeeper(
|
|
public ZooKeeper(
|
|
String connectString,
|
|
String connectString,
|
|
@@ -566,12 +556,7 @@ public class ZooKeeper implements AutoCloseable {
|
|
* @throws IOException
|
|
* @throws IOException
|
|
* in cases of network failure
|
|
* in cases of network failure
|
|
* @throws IllegalArgumentException
|
|
* @throws IllegalArgumentException
|
|
- * if any of the following is true:
|
|
|
|
- * <ul>
|
|
|
|
- * <li> if an invalid chroot path is specified
|
|
|
|
- * <li> for an invalid list of ZooKeeper hosts
|
|
|
|
- * <li> watcher is null
|
|
|
|
- * </ul>
|
|
|
|
|
|
+ * if an invalid chroot path is specified
|
|
*/
|
|
*/
|
|
public ZooKeeper(
|
|
public ZooKeeper(
|
|
String connectString,
|
|
String connectString,
|
|
@@ -639,12 +624,7 @@ public class ZooKeeper implements AutoCloseable {
|
|
* @throws IOException
|
|
* @throws IOException
|
|
* in cases of network failure
|
|
* in cases of network failure
|
|
* @throws IllegalArgumentException
|
|
* @throws IllegalArgumentException
|
|
- * if any of the following is true:
|
|
|
|
- * <ul>
|
|
|
|
- * <li> if an invalid chroot path is specified
|
|
|
|
- * <li> for an invalid list of ZooKeeper hosts
|
|
|
|
- * <li> watcher is null
|
|
|
|
- * </ul>
|
|
|
|
|
|
+ * if an invalid chroot path is specified
|
|
*/
|
|
*/
|
|
public ZooKeeper(
|
|
public ZooKeeper(
|
|
String connectString,
|
|
String connectString,
|
|
@@ -660,7 +640,6 @@ public class ZooKeeper implements AutoCloseable {
|
|
sessionTimeout,
|
|
sessionTimeout,
|
|
watcher);
|
|
watcher);
|
|
|
|
|
|
- validateWatcher(watcher);
|
|
|
|
this.clientConfig = clientConfig != null ? clientConfig : new ZKClientConfig();
|
|
this.clientConfig = clientConfig != null ? clientConfig : new ZKClientConfig();
|
|
this.hostProvider = hostProvider;
|
|
this.hostProvider = hostProvider;
|
|
ConnectStringParser connectStringParser = new ConnectStringParser(connectString);
|
|
ConnectStringParser connectStringParser = new ConnectStringParser(connectString);
|
|
@@ -745,12 +724,7 @@ public class ZooKeeper implements AutoCloseable {
|
|
* @throws IOException
|
|
* @throws IOException
|
|
* in cases of network failure
|
|
* in cases of network failure
|
|
* @throws IllegalArgumentException
|
|
* @throws IllegalArgumentException
|
|
- * if any of the following is true:
|
|
|
|
- * <ul>
|
|
|
|
- * <li> if an invalid chroot path is specified
|
|
|
|
- * <li> for an invalid list of ZooKeeper hosts
|
|
|
|
- * <li> watcher is null
|
|
|
|
- * </ul>
|
|
|
|
|
|
+ * if an invalid chroot path is specified
|
|
*/
|
|
*/
|
|
public ZooKeeper(
|
|
public ZooKeeper(
|
|
String connectString,
|
|
String connectString,
|
|
@@ -812,12 +786,7 @@ public class ZooKeeper implements AutoCloseable {
|
|
* @throws IOException
|
|
* @throws IOException
|
|
* in cases of network failure
|
|
* in cases of network failure
|
|
* @throws IllegalArgumentException
|
|
* @throws IllegalArgumentException
|
|
- * if any of the following is true:
|
|
|
|
- * <ul>
|
|
|
|
- * <li> if an invalid chroot path is specified
|
|
|
|
- * <li> for an invalid list of ZooKeeper hosts
|
|
|
|
- * <li> watcher is null
|
|
|
|
- * </ul>
|
|
|
|
|
|
+ * if an invalid chroot path is specified
|
|
*/
|
|
*/
|
|
public ZooKeeper(
|
|
public ZooKeeper(
|
|
String connectString,
|
|
String connectString,
|
|
@@ -883,13 +852,8 @@ public class ZooKeeper implements AutoCloseable {
|
|
* password for this session
|
|
* password for this session
|
|
*
|
|
*
|
|
* @throws IOException in cases of network failure
|
|
* @throws IOException in cases of network failure
|
|
- * @throws IllegalArgumentException
|
|
|
|
- * if any of the following is true:
|
|
|
|
- * <ul>
|
|
|
|
- * <li> if an invalid chroot path is specified
|
|
|
|
- * <li> for an invalid list of ZooKeeper hosts
|
|
|
|
- * <li> watcher is null
|
|
|
|
- * </ul>
|
|
|
|
|
|
+ * @throws IllegalArgumentException if an invalid chroot path is specified
|
|
|
|
+ * @throws IllegalArgumentException for an invalid list of ZooKeeper hosts
|
|
*/
|
|
*/
|
|
public ZooKeeper(
|
|
public ZooKeeper(
|
|
String connectString,
|
|
String connectString,
|
|
@@ -962,13 +926,7 @@ public class ZooKeeper implements AutoCloseable {
|
|
* @param aHostProvider
|
|
* @param aHostProvider
|
|
* use this as HostProvider to enable custom behaviour.
|
|
* use this as HostProvider to enable custom behaviour.
|
|
* @throws IOException in cases of network failure
|
|
* @throws IOException in cases of network failure
|
|
- * @throws IllegalArgumentException
|
|
|
|
- * if any of the following is true:
|
|
|
|
- * <ul>
|
|
|
|
- * <li> if an invalid chroot path is specified
|
|
|
|
- * <li> for an invalid list of ZooKeeper hosts
|
|
|
|
- * <li> watcher is null
|
|
|
|
- * </ul>
|
|
|
|
|
|
+ * @throws IllegalArgumentException if an invalid chroot path is specified
|
|
*/
|
|
*/
|
|
public ZooKeeper(
|
|
public ZooKeeper(
|
|
String connectString,
|
|
String connectString,
|
|
@@ -1055,12 +1013,7 @@ public class ZooKeeper implements AutoCloseable {
|
|
* configuring properties differently compared to other instances
|
|
* configuring properties differently compared to other instances
|
|
* @throws IOException in cases of network failure
|
|
* @throws IOException in cases of network failure
|
|
* @throws IllegalArgumentException if an invalid chroot path is specified
|
|
* @throws IllegalArgumentException if an invalid chroot path is specified
|
|
- * if any of the following is true:
|
|
|
|
- * <ul>
|
|
|
|
- * <li> if an invalid chroot path is specified
|
|
|
|
- * <li> for an invalid list of ZooKeeper hosts
|
|
|
|
- * <li> watcher is null
|
|
|
|
- * </ul>
|
|
|
|
|
|
+ *
|
|
* @since 3.5.5
|
|
* @since 3.5.5
|
|
*/
|
|
*/
|
|
public ZooKeeper(
|
|
public ZooKeeper(
|
|
@@ -1081,7 +1034,6 @@ public class ZooKeeper implements AutoCloseable {
|
|
Long.toHexString(sessionId),
|
|
Long.toHexString(sessionId),
|
|
(sessionPasswd == null ? "<null>" : "<hidden>"));
|
|
(sessionPasswd == null ? "<null>" : "<hidden>"));
|
|
|
|
|
|
- validateWatcher(watcher);
|
|
|
|
this.clientConfig = clientConfig != null ? clientConfig : new ZKClientConfig();
|
|
this.clientConfig = clientConfig != null ? clientConfig : new ZKClientConfig();
|
|
ConnectStringParser connectStringParser = new ConnectStringParser(connectString);
|
|
ConnectStringParser connectStringParser = new ConnectStringParser(connectString);
|
|
this.hostProvider = hostProvider;
|
|
this.hostProvider = hostProvider;
|
|
@@ -1159,13 +1111,7 @@ public class ZooKeeper implements AutoCloseable {
|
|
* allowed while write requests are not. It continues seeking for
|
|
* allowed while write requests are not. It continues seeking for
|
|
* majority in the background.
|
|
* majority in the background.
|
|
* @throws IOException in cases of network failure
|
|
* @throws IOException in cases of network failure
|
|
- * @throws IllegalArgumentException
|
|
|
|
- * if any of the following is true:
|
|
|
|
- * <ul>
|
|
|
|
- * <li> if an invalid chroot path is specified
|
|
|
|
- * <li> for an invalid list of ZooKeeper hosts
|
|
|
|
- * <li> watcher is null
|
|
|
|
- * </ul>
|
|
|
|
|
|
+ * @throws IllegalArgumentException if an invalid chroot path is specified
|
|
*/
|
|
*/
|
|
public ZooKeeper(
|
|
public ZooKeeper(
|
|
String connectString,
|
|
String connectString,
|
|
@@ -1248,10 +1194,8 @@ public class ZooKeeper implements AutoCloseable {
|
|
/**
|
|
/**
|
|
* Specify the default watcher for the connection (overrides the one
|
|
* Specify the default watcher for the connection (overrides the one
|
|
* specified during construction).
|
|
* specified during construction).
|
|
- * @throws IllegalArgumentException if watcher is null
|
|
|
|
*/
|
|
*/
|
|
public synchronized void register(Watcher watcher) {
|
|
public synchronized void register(Watcher watcher) {
|
|
- validateWatcher(watcher);
|
|
|
|
getWatchManager().setDefaultWatcher(watcher);
|
|
getWatchManager().setDefaultWatcher(watcher);
|
|
}
|
|
}
|
|
|
|
|