public ServerBucketProfile(InternalDistributedMember memberId, int version, Bucket bucket, HashSet<BucketServerLocation66> serverLocations) { super(memberId, version, bucket); this.bucketId = bucket.getId(); this.bucketServerLocations = serverLocations; }
public ServerBucketProfile(InternalDistributedMember memberId, int version, Bucket bucket, HashSet<BucketServerLocation66> serverLocations) { super(memberId, version, bucket); this.bucketId = bucket.getId(); this.bucketServerLocations = serverLocations; }
public static int getBucketId(Object b) { if (b.getClass() == PlaceHolderDiskRegion.class) { return PartitionedRegionHelper.getBucketId(((PlaceHolderDiskRegion) b) .getName()); } return ((Bucket) b).getId(); }
public static int getBucketId(Object b) { if (b.getClass() == PlaceHolderDiskRegion.class) { return PartitionedRegionHelper.getBucketId(((PlaceHolderDiskRegion) b) .getName()); } return ((Bucket) b).getId(); }
public static int getBucketId(Object b) { if (b.getClass() == PlaceHolderDiskRegion.class) { return PartitionedRegionHelper.getBucketId(((PlaceHolderDiskRegion) b) .getName()); } return ((Bucket) b).getId(); }
/** * Constructs a new BucketAdvisor for the Bucket owned by RegionAdvisor. * * @param bucket the bucket to provide metadata and advice for * @param regionAdvisor advisor for the PartitionedRegion */ private BucketAdvisor(Bucket bucket, RegionAdvisor regionAdvisor) { super(bucket); this.regionAdvisor = regionAdvisor; this.pRegion = this.regionAdvisor.getPartitionedRegion(); this.redundancyLock = new ReentrantLock(); resetParentAdvisor(bucket.getId()); }
/** * {@inheritDoc} */ @Override public void primaryMoved(Bucket bucket) { final int bucketId = bucket.getId(); final PartitionedRegion pr = bucket.getPartitionedRegion(); synchronized (autoIncMap) { // remove all keys that belong to that bucket for (Object key : autoIncMap.keySet()) { if (bucketId == PartitionedRegionHelper.getHashKey(pr, key)) { autoIncMap.remove(key); } } } }
/** * {@inheritDoc} */ @Override public void primaryMoved(Bucket bucket) { final int bucketId = bucket.getId(); final PartitionedRegion pr = bucket.getPartitionedRegion(); synchronized (autoIncMap) { // remove all keys that belong to that bucket for (Object key : autoIncMap.keySet()) { if (bucketId == PartitionedRegionHelper.getHashKey(pr, key)) { autoIncMap.remove(key); } } } }
/** * {@inheritDoc} */ @Override public void primaryMoved(Bucket bucket) { final int bucketId = bucket.getId(); final PartitionedRegion pr = bucket.getPartitionedRegion(); synchronized (autoIncMap) { // remove all keys that belong to that bucket for (Object key : autoIncMap.keySet()) { if (bucketId == PartitionedRegionHelper.getHashKey(pr, key)) { autoIncMap.remove(key); } } } }
public Map<Integer,BucketAdvisor> getAllBucketAdvisors() { Assert.assertTrue(this.buckets != null); Map<Integer,BucketAdvisor> map = new HashMap<Integer,BucketAdvisor>(); for(int i=0; i<buckets.length; i++){ ProxyBucketRegion pbr = this.buckets[i]; Bucket ret = pbr.getHostedBucketRegion(); if (ret != null) { map.put(ret.getId(),ret.getBucketAdvisor()); } } return map; }
/** * Constructs a new BucketAdvisor for the Bucket owned by RegionAdvisor. * * @param bucket the bucket to provide metadata and advice for * @param regionAdvisor advisor for the PartitionedRegion */ private BucketAdvisor(Bucket bucket, RegionAdvisor regionAdvisor) { super(bucket); this.regionAdvisor = regionAdvisor; this.pRegion = this.regionAdvisor.getPartitionedRegion(); resetParentAdvisor(bucket.getId()); }
private void updateServerBucketProfile() { // check to see if it is clientBucketProfile add it to the RegionAdvisor // data structure which maintains the newly created clientBucketProfile // don't add more than once, but replace existing profile int bucketId = this.getBucket().getId(); Set<ServerBucketProfile> serverProfiles = this.regionAdvisor .getClientBucketProfiles(bucketId); if (serverProfiles == null) { serverProfiles = newSetFromMap(new ConcurrentHashMap<ServerBucketProfile, Boolean>()); this.regionAdvisor.setClientBucketProfiles(bucketId, serverProfiles); } serverProfiles.clear(); for (Profile p : this.profiles) { if (p instanceof ServerBucketProfile) { serverProfiles.add((ServerBucketProfile)p); } } }
private void updateServerBucketProfile() { // check to see if it is clientBucketProfile add it to the RegionAdvisor // data structure which maintains the newly created clientBucketProfile // don't add more than once, but replace existing profile int bucketId = this.getBucket().getId(); Set<ServerBucketProfile> serverProfiles = this.regionAdvisor .getClientBucketProfiles(bucketId); if (serverProfiles == null) { serverProfiles = newSetFromMap(new ConcurrentHashMap<ServerBucketProfile, Boolean>()); this.regionAdvisor.setClientBucketProfiles(bucketId, serverProfiles); } serverProfiles.clear(); for (Profile p : this.profiles) { if (p instanceof ServerBucketProfile) { serverProfiles.add((ServerBucketProfile)p); } } }
private void invokePartitionListeners() { PartitionListener[] listeners = this.pRegion .getPartitionListeners(); if (listeners == null || listeners.length == 0) { return; } for (int i = 0; i < listeners.length; i++) { PartitionListener listener = listeners[i]; if (listener != null) { listener.afterPrimary(getBucket().getId()); } } }
private void invokePartitionListeners() { PartitionListener[] listeners = this.pRegion .getPartitionListeners(); if (listeners == null || listeners.length == 0) { return; } for (int i = 0; i < listeners.length; i++) { PartitionListener listener = listeners[i]; if (listener != null) { listener.afterPrimary(getBucket().getId()); } } }
public void run() { getBucket().getPartitionedRegion().getRedundancyProvider().finishIncompleteBucketCreation(getBucket().getId()); } });
public void run() { getBucket().getPartitionedRegion().getRedundancyProvider().finishIncompleteBucketCreation(getBucket().getId()); } });
/** * @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(); } }
private void assignStartingBucketAdvisor() { if (this.pRegion.isFixedPartitionedRegion()) { List<FixedPartitionAttributesImpl> fpas = this.pRegion .getFixedPartitionAttributesImpl(); if (fpas != null) { int bucketId = getBucket().getId(); for (FixedPartitionAttributesImpl fpa : fpas) { if (fpa.hasBucket(bucketId) && bucketId != fpa.getStartingBucketID()) { startingBucketAdvisor = this.regionAdvisor.getBucketAdvisor( fpa.getStartingBucketID()); break; } } } } }
private void assignStartingBucketAdvisor() { if (this.pRegion.isFixedPartitionedRegion()) { List<FixedPartitionAttributesImpl> fpas = this.pRegion .getFixedPartitionAttributesImpl(); if (fpas != null) { int bucketId = getBucket().getId(); for (FixedPartitionAttributesImpl fpa : fpas) { if (fpa.hasBucket(bucketId) && bucketId != fpa.getStartingBucketID()) { startingBucketAdvisor = this.regionAdvisor.getBucketAdvisor( fpa.getStartingBucketID()); break; } } } } }