@Override public void restarting(DistributedSystem ds, GemFireCache cache, InternalConfigurationPersistenceService sharedConfig) { setMembershipManager(((InternalDistributedSystem) ds).getDM().getMembershipManager()); }
/** * Return true if our owner already knows that this endpoint is departing */ protected boolean isEndpointShuttingDown(DistributedMember id) { return giveUpOnMember(owner.getDM().getMembershipManager(), id); }
private synchronized void findServices() { InternalDistributedSystem sys = InternalDistributedSystem.getAnyInstance(); if (sys != null && services == null) { logger.info("Peer locator found distributed system " + sys); setMembershipManager(sys.getDM().getMembershipManager()); } if (services == null) { try { wait(10000); } catch (InterruptedException ignored) { } } }
@Override public void memberJoined(DistributionManager distributionManager, InternalDistributedMember id) { log("A new member joined: " + id + ". " + system.getDM().getMembershipManager().getView()); }
/** * adds the log as a membership listener to the given system and logs the view when members join */ public void monitorUse(InternalDistributedSystem system) { this.system = system; DistributionManager dmgr = system.getDistributionManager(); dmgr.addMembershipListener(this); MembershipManager mmgr = dmgr.getMembershipManager(); if (mmgr != null) { log("Log opened with new distributed system connection. " + system.getDM().getMembershipManager().getView()); } else { // membership manager not initialized? log("Log opened with new distributed system connection. Membership view not yet available in this VM."); } }
final boolean DEBUG = SystemFailure.TRACE_CLOSE; if (dm != null) { MembershipManager mm = dm.getMembershipManager(); if (mm != null) { if (DEBUG) {
protected void waitForCurrentOperations() { // Fix for #48066 - make sure that region operations are completely // distributed to peers before destroying the region. boolean flushOnClose = !Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "no-flush-on-close"); // test hook if (!this.cache.forcedDisconnect() && flushOnClose && this.getDistributionManager().getMembershipManager() != null && this.getDistributionManager().getMembershipManager().isConnected()) { getDistributionAdvisor().forceNewMembershipVersion(); try { getDistributionAdvisor().waitForCurrentOperations(); } catch (Exception e) { // log this but try to close the region so that listeners are invoked logger.warn(String.format("%s: error closing region %s", new Object[] {this, getFullPath()}), e); } } }
DistributedMember getCoordinator() { InternalDistributedSystem ids = InternalDistributedSystem.getConnectedInstance(); if (ids == null || !ids.isConnected()) { return null; } MembershipManager mmgr = ids.getDistributionManager().getMembershipManager(); if (mmgr == null) { return null; } return mmgr.getCoordinator(); } }
private static GMSJoinLeave getGmsJoinLeave() { InternalDistributedSystem distributedSystem = getInternalDistributedSystem(); DistributionManager dm = distributedSystem.getDM(); GMSMembershipManager membershipManager = (GMSMembershipManager) dm.getMembershipManager(); Services services = membershipManager.getServices(); return (GMSJoinLeave) services.getJoinLeave(); }
/** ack-wait-threshold and ack-severe-alert-threshold processing */ private boolean doSevereAlertProcessing() { long now = System.currentTimeMillis(); if (ackSATimeout > 0 && (transmissionStartTime + ackWaitTimeout + ackSATimeout) <= now) { logger.fatal("{} seconds have elapsed waiting for a response from {} for thread {}", (ackWaitTimeout + ackSATimeout) / 1000L, getRemoteAddress(), ackThreadName); // turn off subsequent checks by setting the timeout to zero, then boot the member ackSATimeout = 0; return true; } else if (!ackTimedOut && (0 < ackWaitTimeout) && (transmissionStartTime + ackWaitTimeout) <= now) { logger.warn("{} seconds have elapsed waiting for a response from {} for thread {}", ackWaitTimeout / 1000L, getRemoteAddress(), ackThreadName); ackTimedOut = true; final String state = (connectionState == Connection.STATE_SENDING) ? "Sender has been unable to transmit a message within ack-wait-threshold seconds" : "Sender has been unable to receive a response to a message within ack-wait-threshold seconds"; if (ackSATimeout > 0) { this.owner.getDM().getMembershipManager() .suspectMembers(Collections.singleton(getRemoteAddress()), state); } } return false; }
this.locatorImpl.setMembershipManager(this.myDs.getDM().getMembershipManager());
return; dm.getMembershipManager().requestMemberRemoval(this.remoteAddr, "Disconnected as a slow-receiver");
owner.getDM().getMembershipManager().suspectMember(this.remoteAddr, String.format( "Connection handshake with %s timed out after waiting %s milliseconds.",
/** * initiate suspect processing if a shared/ordered connection is lost and we're not shutting down */ private void initiateSuspicionIfSharedUnordered() { if (this.isReceiver && this.handshakeRead && !this.preserveOrder && this.sharedResource) { if (!this.owner.getConduit().getCancelCriterion().isCancelInProgress()) { this.owner.getDM().getMembershipManager().suspectMember(this.getRemoteAddress(), INITIATING_SUSPECT_PROCESSING); } } }
new CacheServerLoadMessage(load, location, myClientIds); message.setRecipients(locators); MembershipManager mgr = advisor.getDistributionManager().getMembershipManager(); if (mgr == null || !mgr.isBeingSick()) { // test hook advisor.getDistributionManager().putOutgoing(message);
} else if (suspectThem) { if (suspectMembers != null && suspectMembers.size() > 0) { getDistributionManager().getMembershipManager().suspectMembers(suspectMembers, "Failed to respond within ack-wait-threshold");
when(distMgr.getMembershipManager()).thenReturn(membership); when(conduit.getDM()).thenReturn(distMgr); when(conduit.getStats()).thenReturn(mock(DMStats.class));
doReturn(membershipManager).when(distributionManager).getMembershipManager(); doReturn(false).when(distributionManager).isCurrentMember(isA( InternalDistributedMember.class));
ReplyProcessor21 processor = new ReplyProcessor21(dm, target); gr.processorId = processor.getProcessorId(); gr.channelState = dm.getMembershipManager().getMessageState(target, false); if (logger.isTraceEnabled(LogMarker.STATE_FLUSH_OP_VERBOSE) && ((gr.channelState != null) && (gr.channelState.size() > 0))) {
timeToWait, target); try { serverConnection.getCache().getDistributionManager().getMembershipManager() .waitForDeparture(target, timeToWait); } catch (TimeoutException e) {