public void testAddressEquality() throws Exception { IpAddress addr1 = new IpAddress(InetAddress.getLocalHost(), 1234); IpAddress addr2 = new IpAddress(addr1.getIpAddress(), addr1.getPort()); if (!addr1.equals(addr2)) { fail("expected addresses to be equal"); } addr2.setBirthViewId(4); if (!addr1.equals(addr2)) { fail("expected addresses to be equal"); } addr1.setBirthViewId(0); int comparison = addr1.compareTo(addr2); if (comparison >= 0) { fail("expected addresses to be unequal but compareTo returned " + comparison); } }
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); } } }
data=packet.getData(); sender=new IpAddress(sender_addr, sender_port); ((IpAddress)sender).setBirthViewId(-1); stack.gfPeerFunctions.incMcastReadBytes(len); if(len > receive_buf.length) {
((IpAddress)sender).setBirthViewId(-1); ((IpAddress)sender).setProcessId(0); stack.gfPeerFunctions.incUcastReadBytes(len);
while (it.hasNext()) { entry = (IpAddress)it.next(); entry.setBirthViewId(0);
for (Iterator it = new_mbrs.iterator(); it.hasNext(); ) { IpAddress mbr = (IpAddress)it.next(); mbr.setBirthViewId(v.getVid().getId()); // GemStoneAddition - vid in ID
log.info("establishing UNICAST view ID of " + iaddr + " with that of " + memberId); iaddr.setBirthViewId(memberId.getBirthViewId()); Entry e = (Entry)mapEntry.getValue(); e.memberId = memberId;
public static void insertGemFireAttributes(IpAddress addr, Object obj) { MemberAttributes attr = (MemberAttributes)obj; addr.setProcessId(attr.getVmPid()); addr.setVmKind(attr.getVmKind()); addr.setDirectPort(attr.getPort()); addr.setBirthViewId(attr.getVmViewId()); addr.setName(attr.getName()); addr.setRoles(attr.getGroups()); addr.setDurableClientAttributes(attr.getDurableClientAttributes()); addr.setSize(-1); addr.setSize(addr.size(Version.CURRENT_ORDINAL)); }
((IpAddress)gms.local_addr).setBirthViewId(rsp.view.getVid().getId());