当前位置: 首页>>代码示例>>Java>>正文


Java HostProvider.size方法代码示例

本文整理汇总了Java中org.apache.zookeeper.client.HostProvider.size方法的典型用法代码示例。如果您正苦于以下问题:Java HostProvider.size方法的具体用法?Java HostProvider.size怎么用?Java HostProvider.size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.zookeeper.client.HostProvider的用法示例。


在下文中一共展示了HostProvider.size方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ClientCnxn

import org.apache.zookeeper.client.HostProvider; //导入方法依赖的package包/类
/**
 * Creates a connection object. The actual network connect doesn't get
 * established until needed. The start() instance method must be called
 * subsequent to construction.
 *
 * @param chrootPath       - the chroot of this client. Should be removed from this Class in ZOOKEEPER-838
 * @param hostProvider     the list of ZooKeeper servers to connect to
 * @param sessionTimeout   the timeout for connections.
 * @param zooKeeper        the zookeeper object that this connection is related to.
 * @param watcher          watcher for this connection
 * @param clientCnxnSocket the socket implementation used (e.g. NIO/Netty)
 * @param sessionId        session id if re-establishing session
 * @param sessionPasswd    session passwd if re-establishing session
 * @param canBeReadOnly    whether the connection is allowed to go to read-only
 *                         mode in case of partitioning
 * @throws IOException
 */
public ClientCnxn(String chrootPath, HostProvider hostProvider, int sessionTimeout, ZooKeeper zooKeeper,
                  ClientWatchManager watcher, ClientCnxnSocket clientCnxnSocket,
                  long sessionId, byte[] sessionPasswd, boolean canBeReadOnly) {
    this.zooKeeper = zooKeeper;
    this.watcher = watcher;
    this.sessionId = sessionId;
    this.sessionPasswd = sessionPasswd;
    this.sessionTimeout = sessionTimeout;
    this.hostProvider = hostProvider;
    this.chrootPath = chrootPath;

    connectTimeout = sessionTimeout / hostProvider.size();
    readTimeout = sessionTimeout * 2 / 3;
    readOnly = canBeReadOnly;

    sendThread = new SendThread(clientCnxnSocket);
    eventThread = new EventThread();

}
 
开发者ID:blentle,项目名称:zookeeper-src-learning,代码行数:37,代码来源:ClientCnxn.java

示例2: ClientCnxn

import org.apache.zookeeper.client.HostProvider; //导入方法依赖的package包/类
/**
 * Creates a connection object. The actual network connect doesn't get
 * established until needed. The start() instance method must be called
 * subsequent to construction.
 *
 * @param chrootPath - the chroot of this client. Should be removed from this Class in ZOOKEEPER-838
 * @param hostProvider
 *                the list of ZooKeeper servers to connect to
 * @param sessionTimeout
 *                the timeout for connections.
 * @param zooKeeper
 *                the zookeeper object that this connection is related to.
 * @param watcher watcher for this connection
 * @param clientCnxnSocket
 *                the socket implementation used (e.g. NIO/Netty)
 * @param sessionId session id if re-establishing session
 * @param sessionPasswd session passwd if re-establishing session
 * @param canBeReadOnly
 *                whether the connection is allowed to go to read-only
 *                mode in case of partitioning
 * @throws IOException
 */
public ClientCnxn(String chrootPath, HostProvider hostProvider, int sessionTimeout, ZooKeeper zooKeeper,
        ClientWatchManager watcher, ClientCnxnSocket clientCnxnSocket,
        long sessionId, byte[] sessionPasswd, boolean canBeReadOnly) {
    this.zooKeeper = zooKeeper;
    this.watcher = watcher;
    this.sessionId = sessionId;
    this.sessionPasswd = sessionPasswd;
    this.sessionTimeout = sessionTimeout;
    this.hostProvider = hostProvider;
    this.chrootPath = chrootPath;

    connectTimeout = sessionTimeout / hostProvider.size();
    readTimeout = sessionTimeout * 2 / 3;
    readOnly = canBeReadOnly;

    sendThread = new SendThread(clientCnxnSocket);
    eventThread = new EventThread();

}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:42,代码来源:ClientCnxn.java

示例3: ClientCnxn

import org.apache.zookeeper.client.HostProvider; //导入方法依赖的package包/类
/**
 * Creates a connection object. The actual network connect doesn't get
 * established until needed. The start() instance method must be called
 * subsequent to construction.
 *
 * @param chrootPath - the chroot of this client. Should be removed from this Class in ZOOKEEPER-838
 * @param hostProvider
 *                the list of ZooKeeper servers to connect to
 * @param sessionTimeout
 *                the timeout for connections.
 * @param zooKeeper
 *                the zookeeper object that this connection is related to.
 * @param watcher watcher for this connection
 * @param clientCnxnSocket
 *                the socket implementation used (e.g. NIO/Netty)
 * @param sessionId session id if re-establishing session
 * @param sessionPasswd session passwd if re-establishing session
 * @param canBeReadOnly
 *                whether the connection is allowed to go to read-only
 *                mode in case of partitioning
 * @throws IOException
 */
public ClientCnxn(String chrootPath, HostProvider hostProvider, int sessionTimeout, ZooKeeper zooKeeper,
        ClientWatchManager watcher, ClientCnxnSocket clientCnxnSocket,
        long sessionId, byte[] sessionPasswd, boolean canBeReadOnly) {
    this.zooKeeper = zooKeeper;
    this.watcher = watcher;
    this.sessionId = sessionId;
    this.sessionPasswd = sessionPasswd;
    this.sessionTimeout = sessionTimeout;
    this.hostProvider = hostProvider;
    this.chrootPath = chrootPath;

    connectTimeout = sessionTimeout / hostProvider.size();
    readTimeout = sessionTimeout * 2 / 3;
    readOnly = canBeReadOnly;

    sendThread = new SendThread(clientCnxnSocket);
    eventThread = new EventThread();
    this.clientConfig=zooKeeper.getClientConfig();
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:42,代码来源:ClientCnxn.java

示例4: ClientCnxn

import org.apache.zookeeper.client.HostProvider; //导入方法依赖的package包/类
/**
 * Creates a connection object. The actual network connect doesn't get
 * established until needed. The start() instance method must be called
 * subsequent to construction.
 *
 * @param chrootPath - the chroot of this client. Should be removed from this Class in ZOOKEEPER-838
 * @param hostProvider
 *                the list of ZooKeeper servers to connect to
 * @param sessionTimeout
 *                the timeout for connections.
 * @param zooKeeper
 *                the zookeeper object that this connection is related to.
 * @param watcher watcher for this connection
 * @param clientCnxnSocket
 *                the socket implementation used (e.g. NIO/Netty)
 * @param sessionId session id if re-establishing session
 * @param sessionPasswd session passwd if re-establishing session
 * @param canBeReadOnly
 *                whether the connection is allowed to go to read-only
 *                mode in case of partitioning
 * @throws IOException
 */
public ClientCnxn(String chrootPath, HostProvider hostProvider, int sessionTimeout, ZooKeeper zooKeeper,
        ClientWatchManager watcher, ClientCnxnSocket clientCnxnSocket,
        long sessionId, byte[] sessionPasswd, boolean canBeReadOnly) {
    this.zooKeeper = zooKeeper;
    this.watcher = watcher;
    this.sessionId = sessionId;
    this.sessionPasswd = sessionPasswd;
    this.sessionTimeout = sessionTimeout;
    this.hostProvider = hostProvider;
    this.chrootPath = chrootPath;

    connectTimeout = sessionTimeout / hostProvider.size();
    readTimeout = sessionTimeout * 2 / 3;
    readOnly = canBeReadOnly;

    sendThread = new SendThread(clientCnxnSocket);
    eventThread = new EventThread();
}
 
开发者ID:gerritjvv,项目名称:bigstreams,代码行数:41,代码来源:ClientCnxn.java

示例5: ClientCnxn

import org.apache.zookeeper.client.HostProvider; //导入方法依赖的package包/类
/**
 * Creates a connection object. The actual network connect doesn't get
 * established until needed. The start() instance method must be called
 * subsequent to construction.
 *
 * @param chrootPath - the chroot of this client. Should be removed from this Class in ZOOKEEPER-838
 * @param hostProvider
 *                the list of ZooKeeper servers to connect to
 * @param sessionTimeout
 *                the timeout for connections.
 * @param zooKeeper
 *                the zookeeper object that this connection is related to.
 * @param watcher watcher for this connection
 * @param clientCnxnSocket
 *                the socket implementation used (e.g. NIO/Netty)
 * @param sessionId session id if re-establishing session
 * @param sessionPasswd session passwd if re-establishing session
 * @param canBeReadOnly
 *                whether the connection is allowed to go to read-only
 *                mode in case of partitioning
 * @throws IOException
 */
public ClientCnxn(String chrootPath, HostProvider hostProvider, int sessionTimeout, ZooKeeper zooKeeper,
        ClientWatchManager watcher, ClientCnxnSocket clientCnxnSocket,
        long sessionId, byte[] sessionPasswd, boolean canBeReadOnly) {
    this.zooKeeper = zooKeeper;
    this.watcher = watcher;
    this.sessionId = sessionId;
    this.sessionPasswd = sessionPasswd;
    this.sessionTimeout = sessionTimeout;
    this.hostProvider = hostProvider;
    this.chrootPath = chrootPath;
    connectTimeout = sessionTimeout / hostProvider.size();
    readTimeout = sessionTimeout * 2 / 3;
    readOnly = canBeReadOnly;

    sendThread = new SendThread(clientCnxnSocket);
    eventThread = new EventThread();

}
 
开发者ID:panpap,项目名称:LoadBalanced_zk,代码行数:41,代码来源:ClientCnxn.java


注:本文中的org.apache.zookeeper.client.HostProvider.size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。