Package com.hazelcast.instance

Examples of com.hazelcast.instance.MemberImpl


        @Override
        public void readData(ObjectDataInput in)
                throws IOException {
            name = in.readUTF();
            member = new MemberImpl();
            member.readData(in);
        }
View Full Code Here


    @Override
    protected void readInternal(ObjectDataInput in)
            throws IOException {
        name = in.readUTF();
        origin = new MemberImpl();
        origin.readData(in);
        recordCount = in.readInt();
        replicatedRecords = new ReplicatedRecord[recordCount];
        for (int i = 0; i < recordCount; i++) {
            ReplicatedRecord replicatedRecord = new ReplicatedRecord();
View Full Code Here

            if (memberGroup.size() == 0) {
                continue;
            }
            if (memberGroup instanceof SingleMemberGroup || memberGroup.size() == 1) {
                nodeGroup = new SingleNodeGroup();
                MemberImpl next = (MemberImpl) memberGroup.iterator().next();
                nodeGroup.addNode(next.getAddress());
            } else {
                nodeGroup = new DefaultNodeGroup();
                Iterator<Member> iter = memberGroup.iterator();
                while (iter.hasNext()) {
                    MemberImpl next = (MemberImpl) iter.next();
                    nodeGroup.addNode(next.getAddress());
                }
            }
            nodeGroups.add(nodeGroup);
        }
        return nodeGroups;
View Full Code Here

        NodeEngine nodeEngine = getNodeEngine();
        if (nodeEngine == null) {
            return false;
        }

        MemberImpl destination = nodeEngine.getClusterService().getMember(migrationInfo.getDestination());
        return destination == null;
    }
View Full Code Here

    private void fireMembershipEvent(Map<String, MemberImpl> prevMembers) {
        final List<MembershipEvent> events = new LinkedList<MembershipEvent>();
        final Set<Member> eventMembers = Collections.unmodifiableSet(new LinkedHashSet<Member>(members));
        for (MemberImpl member : members) {
            final MemberImpl former = prevMembers.remove(member.getUuid());
            if (former == null) {
                events.add(new MembershipEvent(client.getCluster(), member, MembershipEvent.MEMBER_ADDED, eventMembers));
            }
        }
        for (MemberImpl member : prevMembers.values()) {
View Full Code Here

        while (!Thread.currentThread().isInterrupted()) {
            final Data clientResponseData = conn.read();
            final ClientResponse clientResponse = serializationService.toObject(clientResponseData);
            final Object eventObject = serializationService.toObject(clientResponse.getResponse());
            final ClientMembershipEvent event = (ClientMembershipEvent) eventObject;
            final MemberImpl member = (MemberImpl) event.getMember();
            boolean membersUpdated = false;
            if (event.getEventType() == MembershipEvent.MEMBER_ADDED) {
                members.add(member);
                membersUpdated = true;
            } else if (event.getEventType() == ClientMembershipEvent.MEMBER_REMOVED) {
View Full Code Here

        }
    }

    @Override
    public void memberRemoved(final MembershipEvent event) {
        final MemberImpl member = (MemberImpl) event.getMember();
        final Address address = member.getAddress();
        if (address == null) {
            LOGGER.warning("Member's address is null " + member);
            return;
        }
        final ClientConnection clientConnection = connections.get(address);
View Full Code Here

    public Router(LoadBalancer loadBalancer) {
        this.loadBalancer = loadBalancer;
    }

    public Address next() {
        final MemberImpl member = (MemberImpl) loadBalancer.next();
        if (member == null) {
            return null;
        } else {
            return member.getAddress();
        }
    }
View Full Code Here

        t1.addMessageListener(createMessageListener(l1));
        t2.addMessageListener(createMessageListener(l2));
        t3.addMessageListener(createMessageListener(l3));

        MemberImpl m1 = (MemberImpl) h1.getCluster().getLocalMember();
        MemberImpl m2 = (MemberImpl) h2.getCluster().getLocalMember();
        MemberImpl m3 = (MemberImpl) h3.getCluster().getLocalMember();

        Address a1 = m1.getAddress();
        Address a2 = m2.getAddress();
        Address a3 = m3.getAddress();

        Field original = HazelcastInstanceProxy.class.getDeclaredField("original");
        original.setAccessible(true);

        HazelcastInstanceImpl impl1 = (HazelcastInstanceImpl) original.get(h1);
View Full Code Here

            publisher.writeData(out);
            out.writeUTF(data);
        }

        public void readData(ObjectDataInput in) throws IOException {
            publisher = new MemberImpl();
            publisher.readData(in);
            data = in.readUTF();
        }
View Full Code Here

TOP

Related Classes of com.hazelcast.instance.MemberImpl

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.