Package org.apache.zookeeper

Examples of org.apache.zookeeper.ClientCnxn$Packet


      Class<? extends Packet> packetClass = (Class<? extends Packet>) packets[packetId];
      if (packetClass == null) {
        return null;
      }
      Constructor<? extends Packet> c = packetClass.getConstructor(new Class[]{});
      Packet r = c.newInstance(blank);

      return newInstance(packetId, r);
    } catch (SecurityException e) {
      throw new RuntimeException(e);
    } catch (NoSuchMethodException e) {
View Full Code Here


    syncFlushPacketQueue(packetWrappers);
  }

  public void syncFlushPacketQueue(MCCraftPacket[] packetWrappers) {
    while (!resyncQueue.isEmpty()) {
      Packet p = resyncQueue.pollFirst();
      if (p != null) {
        syncedSendPacket(p, packetWrappers);
      }
    }
  }
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);
                    // 添加第二组集群列表
                    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$Packet

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.