void setColocatedWithRegion(final PartitionedRegion colocatedWithRegion) { this.colocatedWithRegion = colocatedWithRegion; if (colocatedWithRegion != null) { // In colocation chain, child region inherita the fixed partitin // attributes from parent region. this.fixedPAttrs = colocatedWithRegion.getFixedPartitionAttributesImpl(); this.fixedPASet = colocatedWithRegion.fixedPASet; synchronized (colocatedWithRegion.colocatedByList) { colocatedWithRegion.colocatedByList.add(this); } } else { this.fixedPAttrs = this.partitionAttributes.getFixedPartitionAttributes(); this.fixedPASet = 0; } }
public static FixedPartitionAttributesData[] getFixedPartitionAttributesData(PartitionAttributes partAttrs) { FixedPartitionAttributesData[] fixedPartitionAttributesTable = new FixedPartitionAttributesData[partAttrs .getFixedPartitionAttributes().size()]; Iterator<FixedPartitionAttributes> it = partAttrs.getFixedPartitionAttributes().iterator(); int j = 0; while (it.hasNext()) { FixedPartitionAttributes fa = it.next(); FixedPartitionAttributesData data = new FixedPartitionAttributesData(fa.getPartitionName(), fa.isPrimary(), fa .getNumBuckets()); fixedPartitionAttributesTable[j] = data; j++; } return fixedPartitionAttributesTable; }
public static FixedPartitionAttributesData[] getFixedPartitionAttributesData(PartitionAttributes partAttrs) { FixedPartitionAttributesData[] fixedPartitionAttributesTable = new FixedPartitionAttributesData[partAttrs .getFixedPartitionAttributes().size()]; Iterator<FixedPartitionAttributes> it = partAttrs.getFixedPartitionAttributes().iterator(); int j = 0; while (it.hasNext()) { FixedPartitionAttributes fa = it.next(); FixedPartitionAttributesData data = new FixedPartitionAttributesData(fa.getPartitionName(), fa.isPrimary(), fa .getNumBuckets()); fixedPartitionAttributesTable[j] = data; j++; } return fixedPartitionAttributesTable; }
/** * Returns the partition attributes as a string. For use only by {@link * RegionDescription#partitionAttributesToString(PartitionAttributes)}. */ protected static synchronized String partitionAttributesToString( PartitionAttributes p) { if (p == null) { return "null"; } StringBuffer buf = new StringBuffer(); buf.append("\n colocatedWith: " + p.getColocatedWith()); buf.append("\n fixedPartitionAttributes: " + p.getFixedPartitionAttributes()); buf.append("\n localMaxMemory: " + p.getLocalMaxMemory()); buf.append("\n partitionListeners: " + Arrays.toString(p.getPartitionListeners())); buf.append("\n partitionResolver: " + p.getPartitionResolver()); buf.append("\n recoveryDelay: " + p.getRecoveryDelay()); buf.append("\n redundantCopies: " + p.getRedundantCopies()); buf.append("\n startupRecoveryDelay: " + p.getStartupRecoveryDelay()); buf.append("\n totalMaxMemory: " + p.getTotalMaxMemory()); buf.append("\n totalNumBuckets: " + p.getTotalNumBuckets()); return buf.toString(); }
List<FixedPartitionAttributes> fpaList = partitionAttributes.getFixedPartitionAttributes();
List<FixedPartitionAttributes> fpaList = partitionAttributes.getFixedPartitionAttributes();
&& pa.getPartitionResolver() == null && pa.getPartitionListeners().length == 0 && (pa.getFixedPartitionAttributes() == null || pa.getFixedPartitionAttributes().isEmpty())) { return; .getFixedPartitionAttributes(); if (staticAttrs != null) { generateFixedPartitionAttributes(FIXED_PARTITION_ATTRIBUTES, staticAttrs);
&& pa.getPartitionResolver() == null && pa.getPartitionListeners().length == 0 && (pa.getFixedPartitionAttributes() == null || pa.getFixedPartitionAttributes().isEmpty())) { return; .getFixedPartitionAttributes(); if (staticAttrs != null) { generateFixedPartitionAttributes(FIXED_PARTITION_ATTRIBUTES, staticAttrs);
protected PartitionedRegionBridge(Region<K, V> region) { super(region); this.parRegion = (PartitionedRegion)region; this.prStats = parRegion.getPrStats(); PartitionAttributes<K, V> partAttrs = parRegion.getPartitionAttributes(); this.parRegionMonitor = new MBeanStatsMonitor(PAR_REGION_MONITOR); this.configurePartitionRegionMetrics(); this.configuredRedundancy = partAttrs.getRedundantCopies(); this.partitionAttributesData = RegionMBeanCompositeDataFactory.getPartitionAttributesData(partAttrs); if (partAttrs.getFixedPartitionAttributes() != null) { this.fixedPartitionAttributesTable = RegionMBeanCompositeDataFactory.getFixedPartitionAttributesData(partAttrs); } parRegionMonitor.addStatisticsToMonitor(prStats.getStats()); }
protected PartitionedRegionBridge(Region<K, V> region) { super(region); this.parRegion = (PartitionedRegion)region; this.prStats = parRegion.getPrStats(); PartitionAttributes<K, V> partAttrs = parRegion.getPartitionAttributes(); this.parRegionMonitor = new MBeanStatsMonitor(PAR_REGION_MONITOR); this.configurePartitionRegionMetrics(); this.configuredRedundancy = partAttrs.getRedundantCopies(); this.partitionAttributesData = RegionMBeanCompositeDataFactory.getPartitionAttributesData(partAttrs); if (partAttrs.getFixedPartitionAttributes() != null) { this.fixedPartitionAttributesTable = RegionMBeanCompositeDataFactory.getFixedPartitionAttributesData(partAttrs); } parRegionMonitor.addStatisticsToMonitor(prStats.getStats()); }
PartitionedRegion pr = (PartitionedRegion)aRegion; if (pr.getAttributes().getPartitionAttributes() .getFixedPartitionAttributes() == null) { return;
/** * Task to verify colocation */ protected void verifyCoLocation() { //Set<Region<?, ?>> regionSet = theCache.rootRegions(); Set<Region<?, ?>> regionSet = ((FixedPartitioningTest)testInstance) .getTestRegions(); for (Region aRegion : regionSet) { if (aRegion instanceof PartitionedRegion) { PartitionedRegion pr = (PartitionedRegion)aRegion; if (pr.getAttributes().getPartitionAttributes() .getFixedPartitionAttributes() != null) { verifyBucketCoLocation(pr); verifyPrimaryBucketCoLocation(pr); } } else { Log .getLogWriter() .info( "The region " + aRegion.getName() + " is not partitioned region and hence need not verify custom partitioning"); } } }
assertEquals(pa.getPartitionResolver(), resolver); List<FixedPartitionAttributesImpl> fixedPartitionsList = pa .getFixedPartitionAttributes(); if (isColocated) { assertNull(fixedPartitionsList);
this.fixedPAttrs = this.partitionAttributes.getFixedPartitionAttributes(); this.fixedPASet = 0;
PartitionedRegion pr = (PartitionedRegion)aRegion; if (pr.getAttributes().getPartitionAttributes() .getFixedPartitionAttributes() != null) { printVmParitionInfo(pr); verifyPrimaryFixedPartitioning(pr);
@SuppressWarnings("unchecked") public void setAll(@SuppressWarnings("rawtypes") PartitionAttributes pa) { setRedundantCopies(pa.getRedundantCopies()); setLocalProperties(pa.getLocalProperties()); setGlobalProperties(pa.getGlobalProperties()); setLocalMaxMemory(pa.getLocalMaxMemory()); setTotalMaxMemory(pa.getTotalMaxMemory()); setTotalNumBuckets(pa.getTotalNumBuckets()); setPartitionResolver(pa.getPartitionResolver()); setColocatedWith(pa.getColocatedWith()); setRecoveryDelay(pa.getRecoveryDelay()); setStartupRecoveryDelay(pa.getStartupRecoveryDelay()); setEnableOffHeapMemory(((PartitionAttributesImpl) pa).getEnableOffHeapMemory()); addFixedPartitionAttributes(pa.getFixedPartitionAttributes()); }
@SuppressWarnings("unchecked") public void setAll(@SuppressWarnings("rawtypes") PartitionAttributes pa) { setRedundantCopies(pa.getRedundantCopies()); setLocalProperties(pa.getLocalProperties()); setGlobalProperties(pa.getGlobalProperties()); setLocalMaxMemory(pa.getLocalMaxMemory()); setTotalMaxMemory(pa.getTotalMaxMemory()); setTotalNumBuckets(pa.getTotalNumBuckets()); setPartitionResolver(pa.getPartitionResolver()); setColocatedWith(pa.getColocatedWith()); setRecoveryDelay(pa.getRecoveryDelay()); setStartupRecoveryDelay(pa.getStartupRecoveryDelay()); setOffHeap(((PartitionAttributesImpl) pa).getOffHeap()); addFixedPartitionAttributes(pa.getFixedPartitionAttributes()); }
+ regAttrs.getPartitionAttributes().getFixedPartitionAttributes());