/** * GemStoneAddition - notify interested parties that we've selected an initial * coordinator and joined the group */ protected void notifyOfCoordinator(Address coord) { GossipServer gs = GossipServer.getInstance(); if (gs != null) { gs.setCoordinator(coord); } }
/** test hook for GemFire - see how many members are in the discovery set */ public int getMemberCount() { List mbrs = getMembers(CHANNEL_NAME); if (mbrs == null) { return -1; } return mbrs.size(); }
/** * GemStoneAddition - notify interested parties that we've selected an initial * coordinator and joined the group */ protected void notifyOfLocalAddress(Address localAddress) { GossipServer gs = GossipServer.getInstance(); if (gs != null) { gs.setLocalAddress(localAddress); } }
GossipData processGetRequest(String group, Address mbr, boolean sendLocators) { if (!checkCompatibility(mbr)) { log.getLogWriter().warning(ExternalStrings.GossipServer_RECEIVED_GETMEMBERS_REQUEST_FROM_MEMBER_USING_INCOMPATIBLE_INTERNET_PROTOCOL_0, mbr); List mbrs; synchronized (this) { // fix for bug 30341 mbrs=getMembers(group); if (mbr != null) { addMember(group, mbr); persistState(); this.hasDistributedSystem(), this.floatingCoordinatorDisabled, this.networkPartitionDetectionEnabled, (sendLocators?this.locators:null), this.localAddress);
GossipData processRegisterRequest(String group, Address mbr, boolean sendLocators) { if (!checkCompatibility(mbr)) { log.getLogWriter().warning(ExternalStrings.GossipServer_RECEIVED_REGISTRATION_REQUEST_FROM_MEMBER_USING_INCOMPATIBLE_INTERNET_PROTOCOL_0, mbr); } addMember(group, mbr); persistState(); GossipData rsp = new GossipData(); if (sendLocators) { rsp.locators = new Vector(this.locators); } // bug #30341 - wait until the local address is known before replying to a registration if (withDS) { try { synchronized(this.localAddressSync) { while (this.localAddress == null /*&& this.hasDistributedSystem()*/) { this.localAddressSync.wait(); } } } catch (InterruptedException e) { return null; } } rsp.localAddress = this.localAddress; return rsp; }
mbrs=newEntryList(); mbrs.add(newEntry(mbr)); synchronized (groups) { // GemStoneAddition groups.put(group, mbrs); entry=findEntry(mbrs, mbr); if(entry == null) { entry=newEntry(mbr); synchronized (mbrs) { mbrs.add(entry);
public void init(TcpServer server) { super.init(); if (log.getLogWriter().fineEnabled()) { this.log.getLogWriter().fine("Recovering from state file: " + stateFile); } this.timer = new Timer(true); recover(stateFile, locatorString); cache_cleaner=new CacheCleaner(); timer.schedule(cache_cleaner, expiry_time, expiry_time); this.gossipFile = stateFile; }