protected final void initialize() { subInit(); getDistributionManager().addMembershipListener(this.ml); }
protected final void initialize() { subInit(); getDistributionManager().addMembershipListener(this.ml); }
this.dm.addMembershipListener(this);
public void run() { DM dm = getSystem().getDistributionManager(); listener = new TestMembershipListener(); dm.addMembershipListener(listener); } });
this.dm.addMembershipListener(this);
@Override protected void preWait() { this.startedWaiting = true; DM mgr = getDistributionManager(); this.statStart = mgr.getStats().startReplyWait(); // Note we do not use addMembershipListenerAndGetDistributionManagerIds // because this is the startup message and we do not yet have any // members in the dm's list. mgr.addMembershipListener(this); // Set activeMembers = mgr.addMembershipListenerAndGetDistributionManagerIds(this); // synchronized (this.members) { // for (int i = 0; i < getMembers().length; i++) { // if (!activeMembers.contains(getMembers()[i])) { // memberDeparted(getMembers()[i], false); // } // } // } }
@Override protected void preWait() { this.waiting = true; DM mgr = getDistributionManager(); this.statStart = mgr.getStats().startReplyWait(); // Note we do not use addMembershipListenerAndGetDistributionManagerIds // because this is the startup message and we do not yet have any // members in the dm's list. mgr.addMembershipListener(this); // Set activeMembers = mgr.addMembershipListenerAndGetDistributionManagerIds(this); // synchronized (this.members) { // for (int i = 0; i < getMembers().length; i++) { // if (!activeMembers.contains(getMembers()[i])) { // memberDeparted(getMembers()[i], false); // } // } // } }
@Override protected void process(DistributionManager dm) { this.dm = dm; // Remove this node from the set of recipients if (this.farSiders != null) { this.farSiders.remove(dm.getId()); } if (this.processorId != 0) { TXLockService.createDTLS(); // fix bug 38843; no-op if already created synchronized(this) { // Handle potential origin departure this.dm.addMembershipListener(this); // Assume ACK mode, defer processing until we receive a // CommitProcess message if (logger.isDebugEnabled()) { final Object key = getTrackerKey(); logger.debug("Adding key:{} class{} to tracker list", key, key.getClass().getName()); } txTracker.add(this); } if (!this.dm.getDistributionManagerIds().contains(getSender())) { memberDeparted(getSender(), false /*don't care*/); } } else { basicProcess(); } } /**
/** * This method will initialize all the internal components for Management and * Monitoring * * It will a)start an JMX connectorServer b) create a notification hub * c)register the ManagementFunction */ private SystemManagementService init() { try { this.localManager = new LocalManager(repo, system, this,cache); this.localManager.startManager(); this.listener = new ManagementMembershipListener(this); system.getDistributionManager().addMembershipListener(listener); isStarted = true; return this; } catch (CancelException e) { // Rethrow all CancelExceptions (fix for defect 46339) throw e; } catch (Exception e) { // Wrap all other exceptions as ManagementExceptions logger.error(e.getMessage(), e); throw new ManagementException(e); } }
protected GfxdDRWLockService(String serviceName, DistributedSystem ds, boolean isDistributed, boolean destroyOnDisconnect, boolean automateFreeResources, long maxVMWriteLockWaitTime, GfxdReadWriteLock lockTemplate, final MembershipListener beforeMemberDeparted) { super(serviceName, ds, isDistributed, destroyOnDisconnect, automateFreeResources); this.localLockMap = new GfxdLocalLockService(serviceName, lockTemplate, maxVMWriteLockWaitTime); this.beforeMemberDeparted = beforeMemberDeparted; this.traceOn = getLogWriter().fineEnabled() || GemFireXDUtils.TraceLock || SanityManager.TRACE_ON(GfxdConstants.TRACE_DDLOCK); // register self as membership listener to release orphan locks for departed // or crashed members getDistributionManager().addMembershipListener(this); }
protected GfxdDRWLockService(String serviceName, DistributedSystem ds, boolean isDistributed, boolean destroyOnDisconnect, boolean automateFreeResources, long maxVMWriteLockWaitTime, GfxdReadWriteLock lockTemplate, final MembershipListener beforeMemberDeparted) { super(serviceName, ds, isDistributed, destroyOnDisconnect, automateFreeResources); this.localLockMap = new GfxdLocalLockService(serviceName, lockTemplate, maxVMWriteLockWaitTime); this.beforeMemberDeparted = beforeMemberDeparted; this.traceOn = getLogWriter().fineEnabled() || GemFireXDUtils.TraceLock || SanityManager.TRACE_ON(GfxdConstants.TRACE_DDLOCK); // register self as membership listener to release orphan locks for departed // or crashed members getDistributionManager().addMembershipListener(this); }
protected GfxdDRWLockService(String serviceName, DistributedSystem ds, boolean isDistributed, boolean destroyOnDisconnect, boolean automateFreeResources, long maxVMWriteLockWaitTime, GfxdReadWriteLock lockTemplate, final MembershipListener beforeMemberDeparted) { super(serviceName, ds, isDistributed, destroyOnDisconnect, automateFreeResources); this.localLockMap = new GfxdLocalLockService(serviceName, lockTemplate, maxVMWriteLockWaitTime); this.beforeMemberDeparted = beforeMemberDeparted; this.traceOn = getLogWriter().fineEnabled() || GemFireXDUtils.TraceLock || SanityManager.TRACE_ON(GfxdConstants.TRACE_DDLOCK); // register self as membership listener to release orphan locks for departed // or crashed members getDistributionManager().addMembershipListener(this); }
/** 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; DM 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."); } }
/** 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; DM 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."); } }
/** * Creates instance of grantor for the lock service. * * @param dlock the lock service the grantor is authority for * @param vId unique id that the elder increments for each new grantor */ private DLockGrantor(DLockService dlock, long vId) { this.dm = dlock.getDistributionManager(); CancelCriterion stopper = this.dm.getCancelCriterion(); this.whileInitializing = new StoppableCountDownLatch(stopper, 1); this.untilDestroyed = new StoppableCountDownLatch(stopper, 1); this.dlock = dlock; this.destroyLock = new StoppableReentrantReadWriteLock(stopper); this.versionId.set(vId); this.dm.addMembershipListener(this.membershipListener); this.thread = new DLockGrantorThread(this, stopper); this.dlock.getStats().incGrantors(1); }
/** * Creates instance of grantor for the lock service. * * @param dlock the lock service the grantor is authority for * @param vId unique id that the elder increments for each new grantor */ private DLockGrantor(DLockService dlock, long vId) { this.dm = dlock.getDistributionManager(); CancelCriterion stopper = this.dm.getCancelCriterion(); this.whileInitializing = new StoppableCountDownLatch(stopper, 1); this.untilDestroyed = new StoppableCountDownLatch(stopper, 1); this.dlock = dlock; this.destroyLock = new StoppableReentrantReadWriteLock(stopper); this.versionId.set(vId); this.dm.addMembershipListener(this.membershipListener); this.thread = new DLockGrantorThread(this, stopper); this.dlock.getStats().incGrantors(1); }
/** * This method will initialize all the internal components for Management and * Monitoring * * It will a)start an JMX connectorServer b) create a notification hub * c)register the ManagementFunction */ private SystemManagementService init() { try { this.localManager = new LocalManager(repo, system, this,cache); this.localManager.startManager(); this.listener = new ManagementMembershipListener(this, logger); system.getDistributionManager().addMembershipListener(listener); isStarted = true; return this; } catch (CancelException e) { // Rethrow all CancelExceptions (fix for defect 46339) throw e; } catch (Exception e) { // Wrap all other exceptions as ManagementExceptions logger.error(e); throw new ManagementException(e); } }
/** initializes a new version vector for this region */ protected void createVersionVector() { this.versionVector = RegionVersionVector.create(getVersionMember(), this); if (dataPolicy.withPersistence()) { //copy the versions that we have recovered from disk into //the version vector. RegionVersionVector diskVector = this.diskRegion.getRegionVersionVector(); this.versionVector.recordVersions(diskVector.getCloneForTransmission()); } else if (!dataPolicy.withStorage()) { // version vectors are currently only necessary in empty regions for // tracking canonical member IDs this.versionVector.turnOffRecordingForEmptyRegion(); } if (this.srp != null) { this.versionVector.setIsClientVector(); } this.cache.getDistributionManager().addMembershipListener(this.versionVector); }
/** initializes a new version vector for this region */ protected void createVersionVector() { this.versionVector = RegionVersionVector.create(getVersionMember()); final RegionVersionVector<?> diskVector; if (dataPolicy.withPersistence() && (diskVector = this.diskRegion.getRegionVersionVector()) != null) { // copy the versions that we have recovered from disk into // the version vector. this.versionVector.recordVersions(diskVector .getCloneForTransmission(), null); } else if (!dataPolicy.withStorage()) { // version vectors are currently only necessary in empty regions for // tracking canonical member IDs this.versionVector.turnOffRecordingForEmptyRegion(); } if (this.srp != null) { this.versionVector.setIsClientVector(); } this.cache.getDistributionManager().addMembershipListener( this.versionVector); }
dm.addMembershipListener(this.txMgr);