zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] enixon commented on a change in pull request #1049: ZOOKEEPER-3475 Enable Checkstyle configuration on zookeeper-server
Date Sun, 11 Aug 2019 18:37:48 GMT
enixon commented on a change in pull request #1049: ZOOKEEPER-3475 Enable Checkstyle configuration
on zookeeper-server
URL: https://github.com/apache/zookeeper/pull/1049#discussion_r312748441
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeper.java
 ##########
 @@ -890,340 +917,349 @@ public ZooKeeper(String connectString, int sessionTimeout, Watcher
watcher,
     }
 
     // @VisibleForTesting
-    protected ClientCnxn createConnection(String chrootPath,
-            HostProvider hostProvider, int sessionTimeout, ZooKeeper zooKeeper,
-            ClientWatchManager watcher, ClientCnxnSocket clientCnxnSocket,
-            boolean canBeReadOnly) throws IOException {
-        return new ClientCnxn(chrootPath, hostProvider, sessionTimeout, this,
-                watchManager, clientCnxnSocket, canBeReadOnly);
+    protected ClientCnxn createConnection(
+            String chrootPath,
+            HostProvider hostProvider,
+            int sessionTimeout,
+            ZooKeeper zooKeeper,
+            ClientWatchManager watcher,
+            ClientCnxnSocket clientCnxnSocket,
+            boolean canBeReadOnly
+    ) throws IOException {
+        return new ClientCnxn(
+                chrootPath,
+                hostProvider,
+                sessionTimeout,
+                this,
+                watchManager,
+                clientCnxnSocket,
+                canBeReadOnly);
     }
 
     /**
      * To create a ZooKeeper client object, the application needs to pass a
      * connection string containing a comma separated list of host:port pairs,
      * each corresponding to a ZooKeeper server.
-     * <p>
-     * Session establishment is asynchronous. This constructor will initiate
+     *
+     * <p>Session establishment is asynchronous. This constructor will initiate
      * connection to the server and return immediately - potentially (usually)
      * before the session is fully established. The watcher argument specifies
      * the watcher that will be notified of any changes in state. This
      * notification can come at any point before or after the constructor call
      * has returned.
-     * <p>
-     * The instantiated ZooKeeper client object will pick an arbitrary server
+     *
+     * <p>The instantiated ZooKeeper client object will pick an arbitrary server
      * from the connectString and attempt to connect to it. If establishment of
      * the connection fails, another server in the connect string will be tried
      * (the order is non-deterministic, as we random shuffle the list), until a
      * connection is established. The client will continue attempts until the
      * session is explicitly closed.
-     * <p>
-     * Added in 3.2.0: An optional "chroot" suffix may also be appended to the
+     *
+     * <p>Added in 3.2.0: An optional "chroot" suffix may also be appended to the
      * connection string. This will run the client commands while interpreting
      * all paths relative to this root (similar to the unix chroot command).
-     * <p>
-     *
-     * @param connectString
-     *            comma separated host:port pairs, each corresponding to a zk
-     *            server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002" If
-     *            the optional chroot suffix is used the example would look
-     *            like: "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002/app/a"
-     *            where the client would be rooted at "/app/a" and all paths
-     *            would be relative to this root - ie getting/setting/etc...
-     *            "/foo/bar" would result in operations being run on
-     *            "/app/a/foo/bar" (from the server perspective).
-     * @param sessionTimeout
-     *            session timeout in milliseconds
-     * @param watcher
-     *            a watcher object which will be notified of state changes, may
-     *            also be notified for node events
-     * @param canBeReadOnly
-     *            (added in 3.4) whether the created client is allowed to go to
-     *            read-only mode in case of partitioning. Read-only mode
-     *            basically means that if the client can't find any majority
-     *            servers but there's partitioned server it could reach, it
-     *            connects to one in read-only mode, i.e. read requests are
-     *            allowed while write requests are not. It continues seeking for
-     *            majority in the background.
-     *
-     * @throws IOException
-     *             in cases of network failure
-     * @throws IllegalArgumentException
-     *             if an invalid chroot path is specified
+     *
+     * @param connectString  comma separated host:port pairs, each corresponding to a zk
+     *                       server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002"
If
+     *                       the optional chroot suffix is used the example would look
+     *                       like: "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002/app/a"
+     *                       where the client would be rooted at "/app/a" and all paths
+     *                       would be relative to this root - ie getting/setting/etc...
+     *                       "/foo/bar" would result in operations being run on
+     *                       "/app/a/foo/bar" (from the server perspective).
+     * @param sessionTimeout session timeout in milliseconds
+     * @param watcher        a watcher object which will be notified of state changes, may
+     *                       also be notified for node events
+     * @param canBeReadOnly  (added in 3.4) whether the created client is allowed to go to
+     *                       read-only mode in case of partitioning. Read-only mode
+     *                       basically means that if the client can't find any majority
+     *                       servers but there's partitioned server it could reach, it
+     *                       connects to one in read-only mode, i.e. read requests are
+     *                       allowed while write requests are not. It continues seeking for
+     *                       majority in the background.
+     * @throws IOException              in cases of network failure
+     * @throws IllegalArgumentException if an invalid chroot path is specified
      */
-    public ZooKeeper(String connectString, int sessionTimeout, Watcher watcher,
-            boolean canBeReadOnly) throws IOException {
-        this(connectString, sessionTimeout, watcher, canBeReadOnly,
-                createDefaultHostProvider(connectString));
+    public ZooKeeper(
+            String connectString,
+            int sessionTimeout,
+            Watcher watcher,
+            boolean canBeReadOnly
+    ) throws IOException {
+        this(connectString, sessionTimeout, watcher, canBeReadOnly, createDefaultHostProvider(connectString));
     }
 
     /**
      * To create a ZooKeeper client object, the application needs to pass a
      * connection string containing a comma separated list of host:port pairs,
      * each corresponding to a ZooKeeper server.
-     * <p>
-     * Session establishment is asynchronous. This constructor will initiate
+     *
+     * <p>Session establishment is asynchronous. This constructor will initiate
      * connection to the server and return immediately - potentially (usually)
      * before the session is fully established. The watcher argument specifies
      * the watcher that will be notified of any changes in state. This
      * notification can come at any point before or after the constructor call
      * has returned.
-     * <p>
-     * The instantiated ZooKeeper client object will pick an arbitrary server
+     *
+     * <p>The instantiated ZooKeeper client object will pick an arbitrary server
      * from the connectString and attempt to connect to it. If establishment of
      * the connection fails, another server in the connect string will be tried
      * (the order is non-deterministic, as we random shuffle the list), until a
      * connection is established. The client will continue attempts until the
      * session is explicitly closed.
-     * <p>
-     * Added in 3.2.0: An optional "chroot" suffix may also be appended to the
+     *
+     * <p>Added in 3.2.0: An optional "chroot" suffix may also be appended to the
      * connection string. This will run the client commands while interpreting
      * all paths relative to this root (similar to the unix chroot command).
-     * <p>
-     *
-     * @param connectString
-     *            comma separated host:port pairs, each corresponding to a zk
-     *            server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002" If
-     *            the optional chroot suffix is used the example would look
-     *            like: "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002/app/a"
-     *            where the client would be rooted at "/app/a" and all paths
-     *            would be relative to this root - ie getting/setting/etc...
-     *            "/foo/bar" would result in operations being run on
-     *            "/app/a/foo/bar" (from the server perspective).
-     * @param sessionTimeout
-     *            session timeout in milliseconds
-     * @param watcher
-     *            a watcher object which will be notified of state changes, may
-     *            also be notified for node events
-     * @param canBeReadOnly
-     *            (added in 3.4) whether the created client is allowed to go to
-     *            read-only mode in case of partitioning. Read-only mode
-     *            basically means that if the client can't find any majority
-     *            servers but there's partitioned server it could reach, it
-     *            connects to one in read-only mode, i.e. read requests are
-     *            allowed while write requests are not. It continues seeking for
-     *            majority in the background.
-     * @param conf
-     *            (added in 3.5.2) passing this conf object gives each client the flexibility
of
-     *            configuring properties differently compared to other instances
-     * @throws IOException
-     *             in cases of network failure
-     * @throws IllegalArgumentException
-     *             if an invalid chroot path is specified
+     *
+     * @param connectString  comma separated host:port pairs, each corresponding to a zk
+     *                       server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002"
If
+     *                       the optional chroot suffix is used the example would look
+     *                       like: "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002/app/a"
+     *                       where the client would be rooted at "/app/a" and all paths
+     *                       would be relative to this root - ie getting/setting/etc...
+     *                       "/foo/bar" would result in operations being run on
+     *                       "/app/a/foo/bar" (from the server perspective).
+     * @param sessionTimeout session timeout in milliseconds
+     * @param watcher        a watcher object which will be notified of state changes, may
+     *                       also be notified for node events
+     * @param canBeReadOnly  (added in 3.4) whether the created client is allowed to go to
+     *                       read-only mode in case of partitioning. Read-only mode
+     *                       basically means that if the client can't find any majority
+     *                       servers but there's partitioned server it could reach, it
+     *                       connects to one in read-only mode, i.e. read requests are
+     *                       allowed while write requests are not. It continues seeking for
+     *                       majority in the background.
+     * @param conf           (added in 3.5.2) passing this conf object gives each client
the flexibility of
+     *                       configuring properties differently compared to other instances
+     * @throws IOException              in cases of network failure
+     * @throws IllegalArgumentException if an invalid chroot path is specified
      */
-    public ZooKeeper(String connectString, int sessionTimeout, Watcher watcher,
-            boolean canBeReadOnly, ZKClientConfig conf) throws IOException {
-        this(connectString, sessionTimeout, watcher, canBeReadOnly,
-                createDefaultHostProvider(connectString), conf);
+    public ZooKeeper(
+            String connectString,
+            int sessionTimeout,
+            Watcher watcher,
+            boolean canBeReadOnly,
+            ZKClientConfig conf
+    ) throws IOException {
+        this(
+                connectString,
+                sessionTimeout,
+                watcher,
+                canBeReadOnly,
+                createDefaultHostProvider(connectString),
+                conf);
     }
 
     /**
      * To create a ZooKeeper client object, the application needs to pass a
      * connection string containing a comma separated list of host:port pairs,
      * each corresponding to a ZooKeeper server.
-     * <p>
-     * Session establishment is asynchronous. This constructor will initiate
+     *
+     * <p>Session establishment is asynchronous. This constructor will initiate
      * connection to the server and return immediately - potentially (usually)
      * before the session is fully established. The watcher argument specifies
      * the watcher that will be notified of any changes in state. This
      * notification can come at any point before or after the constructor call
      * has returned.
-     * <p>
-     * The instantiated ZooKeeper client object will pick an arbitrary server
+     *
+     * <p>The instantiated ZooKeeper client object will pick an arbitrary server
      * from the connectString and attempt to connect to it. If establishment of
      * the connection fails, another server in the connect string will be tried
      * (the order is non-deterministic, as we random shuffle the list), until a
      * connection is established. The client will continue attempts until the
      * session is explicitly closed (or the session is expired by the server).
-     * <p>
-     * Added in 3.2.0: An optional "chroot" suffix may also be appended to the
+     *
+     * <p>Added in 3.2.0: An optional "chroot" suffix may also be appended to the
      * connection string. This will run the client commands while interpreting
      * all paths relative to this root (similar to the unix chroot command).
-     * <p>
-     * Use {@link #getSessionId} and {@link #getSessionPasswd} on an established
+     *
+     * <p>Use {@link #getSessionId} and {@link #getSessionPasswd} on an established
      * client connection, these values must be passed as sessionId and
      * sessionPasswd respectively if reconnecting. Otherwise, if not
      * reconnecting, use the other constructor which does not require these
      * parameters.
      *
-     * @param connectString
-     *            comma separated host:port pairs, each corresponding to a zk
-     *            server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002"
-     *            If the optional chroot suffix is used the example would look
-     *            like: "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002/app/a"
-     *            where the client would be rooted at "/app/a" and all paths
-     *            would be relative to this root - ie getting/setting/etc...
-     *            "/foo/bar" would result in operations being run on
-     *            "/app/a/foo/bar" (from the server perspective).
-     * @param sessionTimeout
-     *            session timeout in milliseconds
-     * @param watcher
-     *            a watcher object which will be notified of state changes, may
-     *            also be notified for node events
-     * @param sessionId
-     *            specific session id to use if reconnecting
-     * @param sessionPasswd
-     *            password for this session
-     *
-     * @throws IOException in cases of network failure
+     * @param connectString  comma separated host:port pairs, each corresponding to a zk
+     *                       server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002"
+     *                       If the optional chroot suffix is used the example would look
+     *                       like: "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002/app/a"
+     *                       where the client would be rooted at "/app/a" and all paths
+     *                       would be relative to this root - ie getting/setting/etc...
+     *                       "/foo/bar" would result in operations being run on
+     *                       "/app/a/foo/bar" (from the server perspective).
+     * @param sessionTimeout session timeout in milliseconds
+     * @param watcher        a watcher object which will be notified of state changes, may
+     *                       also be notified for node events
+     * @param sessionId      specific session id to use if reconnecting
+     * @param sessionPasswd  password for this session
+     * @throws IOException              in cases of network failure
      * @throws IllegalArgumentException if an invalid chroot path is specified
      * @throws IllegalArgumentException for an invalid list of ZooKeeper hosts
      */
-    public ZooKeeper(String connectString, int sessionTimeout, Watcher watcher,
-            long sessionId, byte[] sessionPasswd)
-        throws IOException
-    {
+    public ZooKeeper(
+            String connectString,
+            int sessionTimeout,
+            Watcher watcher,
+            long sessionId,
+            byte[] sessionPasswd
+    ) throws IOException {
         this(connectString, sessionTimeout, watcher, sessionId, sessionPasswd, false);
     }
 
     /**
      * To create a ZooKeeper client object, the application needs to pass a
      * connection string containing a comma separated list of host:port pairs,
      * each corresponding to a ZooKeeper server.
-     * <p>
-     * Session establishment is asynchronous. This constructor will initiate
+     *
+     * <p>Session establishment is asynchronous. This constructor will initiate
      * connection to the server and return immediately - potentially (usually)
      * before the session is fully established. The watcher argument specifies
      * the watcher that will be notified of any changes in state. This
      * notification can come at any point before or after the constructor call
      * has returned.
-     * <p>
-     * The instantiated ZooKeeper client object will pick an arbitrary server
+     *
+     * <p>The instantiated ZooKeeper client object will pick an arbitrary server
      * from the connectString and attempt to connect to it. If establishment of
      * the connection fails, another server in the connect string will be tried
      * (the order is non-deterministic, as we random shuffle the list), until a
      * connection is established. The client will continue attempts until the
      * session is explicitly closed (or the session is expired by the server).
-     * <p>
-     * Added in 3.2.0: An optional "chroot" suffix may also be appended to the
+     *
+     * <p>Added in 3.2.0: An optional "chroot" suffix may also be appended to the
      * connection string. This will run the client commands while interpreting
      * all paths relative to this root (similar to the unix chroot command).
-     * <p>
-     * Use {@link #getSessionId} and {@link #getSessionPasswd} on an established
+     *
+     * <p>Use {@link #getSessionId} and {@link #getSessionPasswd} on an established
      * client connection, these values must be passed as sessionId and
      * sessionPasswd respectively if reconnecting. Otherwise, if not
      * reconnecting, use the other constructor which does not require these
      * parameters.
-     * <p>
-     * For backward compatibility, there is another version
+     *
+     * <p>For backward compatibility, there is another version
      * {@link #ZooKeeper(String, int, Watcher, long, byte[], boolean)} which uses
      * default {@link StaticHostProvider}
      *
-     * @param connectString
-     *            comma separated host:port pairs, each corresponding to a zk
-     *            server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002"
-     *            If the optional chroot suffix is used the example would look
-     *            like: "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002/app/a"
-     *            where the client would be rooted at "/app/a" and all paths
-     *            would be relative to this root - ie getting/setting/etc...
-     *            "/foo/bar" would result in operations being run on
-     *            "/app/a/foo/bar" (from the server perspective).
-     * @param sessionTimeout
-     *            session timeout in milliseconds
-     * @param watcher
-     *            a watcher object which will be notified of state changes, may
-     *            also be notified for node events
-     * @param sessionId
-     *            specific session id to use if reconnecting
-     * @param sessionPasswd
-     *            password for this session
-     * @param canBeReadOnly
-     *            (added in 3.4) whether the created client is allowed to go to
-     *            read-only mode in case of partitioning. Read-only mode
-     *            basically means that if the client can't find any majority
-     *            servers but there's partitioned server it could reach, it
-     *            connects to one in read-only mode, i.e. read requests are
-     *            allowed while write requests are not. It continues seeking for
-     *            majority in the background.
-     * @param aHostProvider
-     *            use this as HostProvider to enable custom behaviour.
-     * @throws IOException in cases of network failure
+     * @param connectString  comma separated host:port pairs, each corresponding to a zk
+     *                       server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002"
+     *                       If the optional chroot suffix is used the example would look
+     *                       like: "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002/app/a"
+     *                       where the client would be rooted at "/app/a" and all paths
+     *                       would be relative to this root - ie getting/setting/etc...
+     *                       "/foo/bar" would result in operations being run on
+     *                       "/app/a/foo/bar" (from the server perspective).
+     * @param sessionTimeout session timeout in milliseconds
+     * @param watcher        a watcher object which will be notified of state changes, may
+     *                       also be notified for node events
+     * @param sessionId      specific session id to use if reconnecting
+     * @param sessionPasswd  password for this session
+     * @param canBeReadOnly  (added in 3.4) whether the created client is allowed to go to
+     *                       read-only mode in case of partitioning. Read-only mode
+     *                       basically means that if the client can't find any majority
+     *                       servers but there's partitioned server it could reach, it
+     *                       connects to one in read-only mode, i.e. read requests are
+     *                       allowed while write requests are not. It continues seeking for
+     *                       majority in the background.
+     * @param aHostProvider  use this as HostProvider to enable custom behaviour.
+     * @throws IOException              in cases of network failure
      * @throws IllegalArgumentException if an invalid chroot path is specified
      */
-    public ZooKeeper(String connectString, int sessionTimeout, Watcher watcher,
-            long sessionId, byte[] sessionPasswd, boolean canBeReadOnly,
-            HostProvider aHostProvider) throws IOException {
-    	this(connectString, sessionTimeout, watcher, sessionId, sessionPasswd,
-    			canBeReadOnly, aHostProvider, null);
+    public ZooKeeper(
+            String connectString,
+            int sessionTimeout,
+            Watcher watcher,
+            long sessionId,
+            byte[] sessionPasswd,
+            boolean canBeReadOnly,
+            HostProvider aHostProvider
+    ) throws IOException {
+        this(
+                connectString,
+                sessionTimeout,
+                watcher,
+                sessionId,
+                sessionPasswd,
+                canBeReadOnly,
+                aHostProvider,
+                null);
     }
 
     /**
      * To create a ZooKeeper client object, the application needs to pass a
      * connection string containing a comma separated list of host:port pairs,
      * each corresponding to a ZooKeeper server.
-     * <p>
-     * Session establishment is asynchronous. This constructor will initiate
+     *
+     * <p>Session establishment is asynchronous. This constructor will initiate
      * connection to the server and return immediately - potentially (usually)
      * before the session is fully established. The watcher argument specifies
      * the watcher that will be notified of any changes in state. This
      * notification can come at any point before or after the constructor call
      * has returned.
-     * <p>
-     * The instantiated ZooKeeper client object will pick an arbitrary server
+     *
+     * <p>The instantiated ZooKeeper client object will pick an arbitrary server
      * from the connectString and attempt to connect to it. If establishment of
      * the connection fails, another server in the connect string will be tried
      * (the order is non-deterministic, as we random shuffle the list), until a
      * connection is established. The client will continue attempts until the
      * session is explicitly closed (or the session is expired by the server).
-     * <p>
-     * Added in 3.2.0: An optional "chroot" suffix may also be appended to the
+     *
+     * <p>Added in 3.2.0: An optional "chroot" suffix may also be appended to the
      * connection string. This will run the client commands while interpreting
      * all paths relative to this root (similar to the unix chroot command).
-     * <p>
-     * Use {@link #getSessionId} and {@link #getSessionPasswd} on an established
+     *
+     * <p>Use {@link #getSessionId} and {@link #getSessionPasswd} on an established
      * client connection, these values must be passed as sessionId and
      * sessionPasswd respectively if reconnecting. Otherwise, if not
      * reconnecting, use the other constructor which does not require these
      * parameters.
-     * <p>
-     * For backward compatibility, there is another version
+     *
+     * <p>For backward compatibility, there is another version
      * {@link #ZooKeeper(String, int, Watcher, long, byte[], boolean)} which uses
      * default {@link StaticHostProvider}
      *
-     * @param connectString
-     *            comma separated host:port pairs, each corresponding to a zk
-     *            server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002"
-     *            If the optional chroot suffix is used the example would look
-     *            like: "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002/app/a"
-     *            where the client would be rooted at "/app/a" and all paths
-     *            would be relative to this root - ie getting/setting/etc...
-     *            "/foo/bar" would result in operations being run on
-     *            "/app/a/foo/bar" (from the server perspective).
-     * @param sessionTimeout
-     *            session timeout in milliseconds
-     * @param watcher
-     *            a watcher object which will be notified of state changes, may
-     *            also be notified for node events
-     * @param sessionId
-     *            specific session id to use if reconnecting
-     * @param sessionPasswd
-     *            password for this session
-     * @param canBeReadOnly
-     *            (added in 3.4) whether the created client is allowed to go to
-     *            read-only mode in case of partitioning. Read-only mode
-     *            basically means that if the client can't find any majority
-     *            servers but there's partitioned server it could reach, it
-     *            connects to one in read-only mode, i.e. read requests are
-     *            allowed while write requests are not. It continues seeking for
-     *            majority in the background.
-     * @param aHostProvider
-     *            use this as HostProvider to enable custom behaviour.
-     * @param clientConfig
-     *            (added in 3.5.2) passing this conf object gives each client the flexibility
of
-     *            configuring properties differently compared to other instances
-     * @throws IOException in cases of network failure
+     * @param connectString  comma separated host:port pairs, each corresponding to a zk
+     *                       server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002"
+     *                       If the optional chroot suffix is used the example would look
+     *                       like: "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002/app/a"
+     *                       where the client would be rooted at "/app/a" and all paths
+     *                       would be relative to this root - ie getting/setting/etc...
+     *                       "/foo/bar" would result in operations being run on
+     *                       "/app/a/foo/bar" (from the server perspective).
+     * @param sessionTimeout session timeout in milliseconds
+     * @param watcher        a watcher object which will be notified of state changes, may
+     *                       also be notified for node events
+     * @param sessionId      specific session id to use if reconnecting
+     * @param sessionPasswd  password for this session
+     * @param canBeReadOnly  (added in 3.4) whether the created client is allowed to go to
+     *                       read-only mode in case of partitioning. Read-only mode
+     *                       basically means that if the client can't find any majority
+     *                       servers but there's partitioned server it could reach, it
+     *                       connects to one in read-only mode, i.e. read requests are
+     *                       allowed while write requests are not. It continues seeking for
+     *                       majority in the background.
+     * @param aHostProvider  use this as HostProvider to enable custom behaviour.
+     * @param clientConfig   (added in 3.5.2) passing this conf object gives each client
the flexibility of
+     *                       configuring properties differently compared to other instances
+     * @throws IOException              in cases of network failure
      * @throws IllegalArgumentException if an invalid chroot path is specified
-     *
      * @since 3.5.5
      */
-    public ZooKeeper(String connectString, int sessionTimeout, Watcher watcher,
-    		long sessionId, byte[] sessionPasswd, boolean canBeReadOnly,
-    		HostProvider aHostProvider, ZKClientConfig clientConfig) throws IOException {
-    	LOG.info("Initiating client connection, connectString=" + connectString
-    			+ " sessionTimeout=" + sessionTimeout
-    			+ " watcher=" + watcher
-    			+ " sessionId=" + Long.toHexString(sessionId)
-    			+ " sessionPasswd="
-    			+ (sessionPasswd == null ? "<null>" : "<hidden>"));
+    public ZooKeeper(
+            String connectString,
+            int sessionTimeout,
+            Watcher watcher,
+            long sessionId,
+            byte[] sessionPasswd,
+            boolean canBeReadOnly,
+            HostProvider aHostProvider,
+            ZKClientConfig clientConfig
+    ) throws IOException {
+        LOG.info("Initiating client connection, connectString=" + connectString
 
 Review comment:
   Log formatting could be cleaned.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message