/** * @guarded.By this */ @Override protected void profileUpdated(Profile profile) { super.profileUpdated(profile); if (updateRedundancy() > 0) { // wake up any threads in waitForRedundancy or waitForPrimary this.notifyAll(); } this.regionAdvisor.updateBucketStatus(this.getBucket().getId(), profile.peerMemberId, false); if (logger.isDebugEnabled()) { logger.debug("Profile updated {} Profile : {}", getBucket().getFullPath(), profile); } synchronized (this) { updateServerBucketProfile(); } }
/** * @guarded.By this */ @Override protected void profileCreated(Profile profile) { this.regionAdvisor.incrementBucketCount(profile); super.profileCreated(profile); if (updateRedundancy() > 0) { // wake up any threads in waitForRedundancy or waitForPrimary this.notifyAll(); } this.regionAdvisor.updateBucketStatus(this.getBucket().getId(), profile.peerMemberId, false); if (logger.isDebugEnabled()) { logger.debug("Profile added {} Profile : {}", getBucket().getFullPath(), profile); } synchronized (this){ updateServerBucketProfile(); } }
/** * Called by the RegionAdvisor.profileRemoved, this method * tests to see if the missing member is the primary elector * for this bucket. * * We can't call this method from BucketAdvisor.profileRemoved, * because the primaryElector may not actually host the bucket. * @param profile */ public void checkForLostPrimaryElector(Profile profile) { //If the member that went away was in the middle of creating //the bucket, finish the bucket creation. if(this.primaryElector != null && this.primaryElector.equals(profile.getDistributedMember())) { if (logger.isDebugEnabled()) { logger.debug("Bucket {} lost the member responsible for electing the primary. Finishing bucket creation", getBucket().getFullPath()); } this.primaryElector = getBucket().getDistributionManager().getId(); this.getBucket().getDistributionManager().getWaitingThreadPool().execute(new Runnable() { public void run() { getBucket().getPartitionedRegion().getRedundancyProvider().finishIncompleteBucketCreation(getBucket().getId()); } }); } }
/** * @guarded.By this */ @Override protected void profileRemoved(Profile profile) { if (profile != null) { this.regionAdvisor.updateBucketStatus(this.getBucket().getId(), profile.getDistributedMember(), true); this.regionAdvisor.decrementsBucketCount(profile); } updateRedundancy(); if (logger.isDebugEnabled()) { logger.debug("Profile removed {} the member lost {} Profile : {}", getBucket().getFullPath(), profile.getDistributedMember(), profile); } synchronized (this) { updateServerBucketProfile(); } }
/** * @guarded.By this */ @Override protected void profileUpdated(Profile profile) { super.profileUpdated(profile); if (updateRedundancy() > 0) { // wake up any threads in waitForRedundancy or waitForPrimary this.notifyAll(); } this.regionAdvisor.updateBucketStatus(this.getBucket().getId(), profile.peerMemberId, false); LogWriterI18n log = getLogWriter(); if (log.fineEnabled()) { log.fine("Profile updated " + getBucket().getFullPath() + " Profile : " + profile); } synchronized (this) { updateServerBucketProfile(); } }
/** * @guarded.By this */ @Override protected void profileCreated(Profile profile) { this.regionAdvisor.incrementBucketCount(profile); super.profileCreated(profile); if (updateRedundancy() > 0) { // wake up any threads in waitForRedundancy or waitForPrimary this.notifyAll(); } this.regionAdvisor.updateBucketStatus(this.getBucket().getId(), profile.peerMemberId, false); LogWriterI18n log = getLogWriter(); if (log.fineEnabled()) { log.fine("Profile added " + getBucket().getFullPath() + " Profile : " + profile); } synchronized (this){ updateServerBucketProfile(); } }
/** * Called by the RegionAdvisor.profileRemoved, this method * tests to see if the missing member is the primary elector * for this bucket. * * We can't call this method from BucketAdvisor.profileRemoved, * because the primaryElector may not actually host the bucket. * @param profile */ public void checkForLostPrimaryElector(Profile profile) { //If the member that went away was in the middle of creating //the bucket, finish the bucket creation. if(this.primaryElector != null && this.primaryElector.equals(profile.getDistributedMember())) { LogWriterI18n log = getLogWriter(); if(log.fineEnabled()) { log.fine("Bucket " + getBucket().getFullPath() + " lost the member responsible for electing the primary. Finishing bucket creation"); } this.primaryElector = getBucket().getDistributionManager().getId(); this.getBucket().getDistributionManager().getWaitingThreadPool().execute(new Runnable() { public void run() { getBucket().getPartitionedRegion().getRedundancyProvider().finishIncompleteBucketCreation(getBucket().getId()); } }); } }
/** * @guarded.By this */ @Override protected void profileRemoved(Profile profile) { if (profile != null) { this.regionAdvisor.updateBucketStatus(this.getBucket().getId(), profile.getDistributedMember(), true); this.regionAdvisor.decrementsBucketCount(profile); } updateRedundancy(); LogWriterI18n log = getLogWriter(); if (log.fineEnabled()) { log.fine("Profile removed " + getBucket().getFullPath() + " the member lost " + profile.getDistributedMember() + " Profile : " + profile); } synchronized (this) { updateServerBucketProfile(); } }