public int hashCode() { return this.getPartitionName().hashCode(); }
public boolean equals(final Object obj) { if (obj == null) { return false; } if (this == obj) { return true; } if (!(obj instanceof FixedPartitionAttributesImpl)) { return false; } FixedPartitionAttributesImpl spr = (FixedPartitionAttributesImpl) obj; if (spr.getPartitionName().equals(this.getPartitionName())) { return true; } return false; }
@Override public boolean include(Profile profile) { // probably not needed as all profiles for a partitioned region are // Partition profiles if (profile instanceof PartitionProfile) { PartitionProfile p = (PartitionProfile) profile; if (p.fixedPAttrs != null) { for (FixedPartitionAttributesImpl fpa : p.fixedPAttrs) { if (fpa.getPartitionName().equals(partitionName)) { return true; } } } } return false; } });
private boolean isLocalPrimary(String partitionName) { List<FixedPartitionAttributesImpl> FPAs = this.prRegion.getFixedPartitionAttributesImpl(); if (FPAs != null) { for (FixedPartitionAttributesImpl fpa : FPAs) { if (fpa.getPartitionName().equals(partitionName) && fpa.isPrimary()) { return true; } } } return false; }
private static Set<String> getAllAvailablePartitions(PartitionedRegion region) { Set<String> partitionSet = new HashSet<String>(); List<FixedPartitionAttributesImpl> localFPAs = region.getFixedPartitionAttributesImpl(); if (localFPAs != null) { for (FixedPartitionAttributesImpl fpa : localFPAs) { partitionSet.add(fpa.getPartitionName()); } } List<FixedPartitionAttributesImpl> remoteFPAs = region.getRegionAdvisor().adviseAllFixedPartitionAttributes(); for (FixedPartitionAttributes fpa : remoteFPAs) { partitionSet.add(fpa.getPartitionName()); } return Collections.unmodifiableSet(partitionSet); }
Set<FixedPartitionAttributes> fpAttrsSet = new HashSet<FixedPartitionAttributes>(); for (FixedPartitionAttributesImpl fpa : this.fixedPAttrs) { if (fpa == null || fpa.getPartitionName() == null) { throw new IllegalStateException( "Fixed partition name cannot be null"
/** * This is for FPR, for given partition, we have to return the set of datastores on which the * given partition is defined * * @param partitionName name of the partition for which datastores need to be found out */ private Set<InternalDistributedMember> getFixedPartitionStores(String partitionName) { Set<InternalDistributedMember> members = this.prRegion.getRegionAdvisor().adviseFixedPartitionDataStores(partitionName); List<FixedPartitionAttributesImpl> FPAs = this.prRegion.getFixedPartitionAttributesImpl(); if (FPAs != null) { for (FixedPartitionAttributesImpl fpa : FPAs) { if (fpa.getPartitionName().equals(partitionName)) { members.add((InternalDistributedMember) this.prRegion.getMyId()); } } } return members; }
public void finishIncompleteBucketCreation(int bucketId) { String partitionName = null; final long startTime = PartitionedRegionStats.startTime(); if (this.prRegion.isFixedPartitionedRegion()) { FixedPartitionAttributesImpl fpa = PartitionedRegionHelper.getFixedPartitionAttributesForBucket(this.prRegion, bucketId); partitionName = fpa.getPartitionName(); } createBucketAtomically(bucketId, 0, startTime, true, partitionName); }
if (fpa.getPartitionName().equals(partition)) { isPartitionAvailable = true; partitionNumBuckets = fpa.getNumBuckets(); pr.getRegionAdvisor().adviseAllFixedPartitionAttributes(); for (FixedPartitionAttributesImpl fpa : remoteFPAs) { if (fpa.getPartitionName().equals(partition)) { isPartitionAvailable = true; partitionNumBuckets = fpa.getNumBuckets();
String.format( "For region %s,for partition %s, num-buckets are not same (%s, %s)across nodes.", this.pr.getName(), fpa.getPartitionName(), fpa.getNumBuckets(), otherfpa.getNumBuckets())); "For region %s, number of secondary partitions %s of a partition %s should never exceed number of redundant copies %s.", this.pr.getName(), numSecondaries, fpa.getPartitionName(), this.pr.getRedundantCopies()));
private void updatePartitionMap(PartitionRegionConfig prConfig) { int prId = prConfig.getPRId(); PartitionedRegion pr = null; try { pr = PartitionedRegion.getPRFromId(prId); if (pr != null) { Map<String, Integer[]> partitionMap = pr.getPartitionsMap(); for (FixedPartitionAttributesImpl fxPrAttr : prConfig.getElderFPAs()) { partitionMap.put(fxPrAttr.getPartitionName(), new Integer[] {fxPrAttr.getStartingBucketID(), fxPrAttr.getNumBuckets()}); } } } catch (PRLocallyDestroyedException e) { logger.debug("PRLocallyDestroyedException : Region ={} is locally destroyed on this node", prConfig.getPRId(), e); } } }
this.partitionsMap.put(fxPrAttr.getPartitionName(), new Integer[] {fxPrAttr.getStartingBucketID(), fxPrAttr.getNumBuckets()});
if (fpa.hasBucket(bid)) { startingBucketID = fpa.getStartingBucketID(); partitionName = fpa.getPartitionName(); break; if (fpa.getPartitionName().equals(this.diskRegion.getPartitionName()) && this.diskRegion.getStartingBucketId() != -1) { fpa.setStartingBucketID(this.diskRegion.getStartingBucketId()); partitionedRegion.getPartitionsMap().put(fpa.getPartitionName(), new Integer[] {fpa.getStartingBucketID(), fpa.getNumBuckets()});
FixedPartitionAttributesImpl fpa = PartitionedRegionHelper.getFixedPartitionAttributesForBucket(this, bucketId); partitionName = fpa.getPartitionName(); int startBucketId = fpa.getStartingBucketID(); if (startBucketId == -1) {
FixedPartitionAttributesImpl fpa = PartitionedRegionHelper.getFixedPartitionAttributesForBucket(r, bucketId); partitionName = fpa.getPartitionName();