Package org.apache.zookeeper

Examples of org.apache.zookeeper.ClientCnxn$WatcherSetEventPair


                // 添加第二组集群列表
                for (int i = 1; i < _servers.size(); i++) {
                    String cluster = _servers.get(i);
                    // 强制获取zk中的地址信息
                    ClientCnxn cnxn = (ClientCnxn) ReflectionUtils.getField(clientCnxnField, zk);
                    HostProvider hostProvider = (HostProvider) ReflectionUtils.getField(hostProviderField, cnxn);
                    List<InetSocketAddress> serverAddrs = (List<InetSocketAddress>) ReflectionUtils.getField(serverAddressesField,
                                                                                                             hostProvider);
                    // 添加第二组集群列表
                    serverAddrs.addAll(new ConnectStringParser(cluster).getServerAddresses());
View Full Code Here


    @Test
    public void testClient() {
        ZkClientx zk = ZooKeeperClient.getInstance();
        // 强制获取zk中的地址信息
        final ZooKeeper zkp = ((ZooKeeperx) zk.getConnection()).getZookeeper();
        ClientCnxn cnxn = (ClientCnxn) ReflectionUtils.getField(clientCnxnField, zkp);
        HostProvider hostProvider = (HostProvider) ReflectionUtils.getField(hostProviderField, cnxn);
        List<InetSocketAddress> serverAddrs = (List<InetSocketAddress>) ReflectionUtils.getField(serverAddressesField,
            hostProvider);
        want.number(serverAddrs.size()).isEqualTo(3);
        String s1 = serverAddrs.get(0).getAddress().getHostAddress() + ":" + serverAddrs.get(0).getPort();
View Full Code Here

                // 添加第二组集群列表
                for (int i = 1; i < _servers.size(); i++) {
                    String cluster = _servers.get(i);
                    // 强制获取zk中的地址信息
                    ClientCnxn cnxn = (ClientCnxn) ReflectionUtils.getField(clientCnxnField, zk);
                    HostProvider hostProvider = (HostProvider) ReflectionUtils.getField(hostProviderField, cnxn);
                    List<InetSocketAddress> serverAddrs = (List<InetSocketAddress>) ReflectionUtils.getField(
                                                                                                             serverAddressesField,
                                                                                                             hostProvider);
                    // 添加第二组集群列表
View Full Code Here

TOP

Related Classes of org.apache.zookeeper.ClientCnxn$WatcherSetEventPair

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.