/** * Returns true if the provide member belongs to this membership using * unique ID information as well as the basic checks */ public boolean containsExt(Address member) { if (member == null || !(member instanceof IpAddress)) return false; IpAddress pmbr = (IpAddress)member; synchronized(members) { for (Iterator<IpAddress> it = members.iterator(); it.hasNext(); ) { IpAddress each = it.next(); if (each.equals(pmbr) && each.getBirthViewId() == pmbr.getBirthViewId()) { return true; } } } return false; }
public synchronized void becomeCoordinator(Vector suspects) { if (!(impl instanceof CoordGmsImpl)) { // GemStoneAddition, synchronize and checked for redundant becomeCoordinator log.getLogWriter().info(ExternalStrings.GMS_THIS_MEMBER_0_IS_BECOMING_GROUP_COORDINATOR, this.local_addr/*, new Exception("stack trace")*/); CoordGmsImpl tmp=(CoordGmsImpl)impls.get(COORD); if(tmp == null) { tmp=new CoordGmsImpl(this); impls.put(COORD, tmp); } try { tmp.init(); } catch(Exception e) { log.error(ExternalStrings.GMS_EXCEPTION_SWITCHING_TO_COORDINATOR_ROLE, e); } if (((IpAddress)this.local_addr).getBirthViewId() < 0) { ((IpAddress)this.local_addr).setBirthViewId( this.view_id == null? 0 : this.view_id.getId()); } setImpl(tmp); if (suspects != null && suspects.size() > 0) { List suspectList = new LinkedList(suspects); impl.handleLeave(suspectList, true, Collections.singletonList("Member was suspected of being dead prior to " + this.local_addr + " becoming group coordinator"), false); } } }
IpAddress mbr = (IpAddress)msg.getDest(); if (myViewId != null && mbr.getBirthViewId() > 0 && mbr.getBirthViewId() <= myViewId.getId()) { if (trace) { log.trace("stopping retransmission of message for non member: " + msg);
/** * For Externalizable * * @see java.io.Externalizable */ public void writeExternal(ObjectOutput out) throws IOException { if (ipAddr == null) throw new InternalGemFireError(LocalizedStrings.JGroupMember_ATTEMPT_TO_EXTERNALIZE_NULL_IP_ADDRESS.toLocalizedString()); // ipAddr.writeExternal(out); // do it the way we like byte[] address = ipAddr.getIpAddress().getAddress(); out.writeInt(address.length); // IPv6 compatible out.write(address); out.writeInt(ipAddr.getPort()); out.write(ipAddr.getFlags()); Version.writeOrdinal(out, ipAddr.getVersionOrdinal(), true); byte bytes[] = new MemberAttributes(ipAddr.getDirectPort(), ipAddr.getProcessId(), ipAddr.getVmKind(), ipAddr.getBirthViewId(), ipAddr.getName(), ipAddr.getRoles(), (DurableClientAttributes)ipAddr.getDurableClientAttributes()).toByteArray(); if (bytes == null) out.writeInt(0); else { out.writeInt(bytes.length); out.write(bytes); } }
public MemberAttributes getAttributes() { return new MemberAttributes(ipAddr.getDirectPort(), ipAddr.getProcessId(), ipAddr.getVmKind(), ipAddr.getBirthViewId(), ipAddr.getName(), ipAddr.getRoles(), (DurableClientAttributes)ipAddr.getDurableClientAttributes()); }
public void unsuspect(Address mbr) { if (mbr == null) return; if (((IpAddress)mbr).getBirthViewId() < 0) { // GemStoneAddition - must have birth view ID if (log.getLogWriter().fineEnabled()) { log.getLogWriter().fine("Unsuspect() found view id missing from " + mbr + " which is abnormal if this member isn't in the process of joining"); } return; } // GemStoneAddition - SuspectMember struct SuspectMember sm = new SuspectMember(local_addr, mbr); if (!suspects.containsKey(sm)) { return; } synchronized(suspects) { if (suspects.containsKey(sm)) { // GemStoneAddition - log the unsuspect if this is the membership coordinator if (this.view.getCreator().equals(this.local_addr)) { /*if(trace)*/ log.getLogWriter().info( ExternalStrings.VERIFY_SUSPECT_MEMBER_0_IS_NO_LONGER_SUSPECT, mbr); } suspects.remove(sm); passDown(new Event(Event.UNSUSPECT, mbr)); passUp(new Event(Event.UNSUSPECT, mbr)); } } }
public void messageReceived(DistributionMessage msg) { // bug 36851 - notify failure detection that we've had contact from a member IpAddress addr = ((JGroupMember)msg.getSender().getNetMember()).getAddress(); if (fdProtocol != null) { fdProtocol.messageReceivedFrom(addr); } if (verifySuspectProtocol != null) { if (addr.getBirthViewId() < 0) { if (logger.fineEnabled()) { // if there is no view ID then this is not a valid address logger.fine("Membership: invalid address found in sender of " + msg); } } else { verifySuspectProtocol.unsuspect(addr); } } handleOrDeferMessage(msg); }
if (mbr.getBirthViewId() < 0 && mbrs.contains(mbr)) { log.getLogWriter().info( ExternalStrings. COORDGMSIMPL_REJECTING_0_DUE_TO_REUSED_IDENTITY, mbr);
Map.Entry mapEntry = (Map.Entry)it.next(); IpAddress iaddr = (IpAddress)mapEntry.getKey(); if (iaddr.getBirthViewId() < 0) { Address memberId = view.getMember(iaddr); if (memberId != null
for (Iterator it=suspects.keySet().iterator(); it.hasNext(); ) { IpAddress mbr = (IpAddress)it.next(); if (!v.containsMember(mbr) && mbr.getBirthViewId() < viewId) { removals.add(mbr); obj=msg.getHeader(name); if (msg.getSrc() != null && ((IpAddress)msg.getSrc()).getBirthViewId() >= 0) { unsuspect(msg.getSrc());
MemberAttributes.DEFAULT.getVmPid(), MemberAttributes.DEFAULT.getVmKind(), myAddr.getBirthViewId(), MemberAttributes.DEFAULT.getName(), MemberAttributes.DEFAULT.getGroups(), MemberAttributes.DEFAULT.getDurableClientAttributes()); directChannel.getConduit().setVmViewID(myAddr.getBirthViewId());
if (iaddr.getBirthViewId() >= 0 && this.stack.gfPeerFunctions.isShunnedMemberNoSync(iaddr)) { log.getLogWriter().info( ExternalStrings. COORDGMSIMPL_REJECTING_0_DUE_TO_REUSED_IDENTITY, hdr.mbr);