HazelcastNodeStatus(final Member member_) {
   super(
       member_.getUuid(),
       member_.isLiteMember() ? "client" : "node",
       member_.getInetSocketAddress().toString());
   member = member_;
 }
Esempio n. 2
0
  public Address findNextAddressToSendCreateRequest() {
    int clusterSize = client.getClientClusterService().getSize();
    Member liteMember = null;

    final LoadBalancer loadBalancer = client.getLoadBalancer();
    for (int i = 0; i < clusterSize; i++) {
      Member member = loadBalancer.next();
      if (member != null && !member.isLiteMember()) {
        return member.getAddress();
      } else if (liteMember == null) {
        liteMember = member;
      }
    }

    return liteMember != null ? liteMember.getAddress() : null;
  }
Esempio n. 3
0
  private void testMemberLeftException(String uuid, String host, int port, Member member)
      throws Exception {

    MemberLeftException exception = new MemberLeftException(member);

    ByteArrayOutputStream bout = new ByteArrayOutputStream();
    ObjectOutputStream out = new ObjectOutputStream(bout);
    out.writeObject(exception);

    ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
    ObjectInputStream in = new ObjectInputStream(bin);
    MemberLeftException exception2 = (MemberLeftException) in.readObject();
    MemberImpl member2 = (MemberImpl) exception2.getMember();

    assertEquals(uuid, member2.getUuid());
    assertEquals(host, member2.getAddress().getHost());
    assertEquals(port, member2.getAddress().getPort());
    assertEquals(member.isLiteMember(), member2.isLiteMember());
    assertEquals(member.getVersion(), member2.getVersion());
  }