/** * This method initializes the partitionedRegionDataStore for this PR. * * @param ra * Region attributes */ private void initializeDataStore(RegionAttributes ra) { this.dataStore = PartitionedRegionDataStore.createDataStore(cache, this, ra .getPartitionAttributes()); }
/** * This method initializes the partitionedRegionDataStore for this PR. * * @param ra * Region attributes */ private void initializeDataStore(RegionAttributes ra) { this.dataStore = PartitionedRegionDataStore.createDataStore(cache, this, ra .getPartitionAttributes()); }
@Override public final <K, V> Set<Integer> getLocalBucketSet(Region<K, V> region) { if (region.getAttributes().getPartitionAttributes() != null) { return getPRBucketSet((PartitionedRegion)region); } return null; }
@Override public final <K, V> Set<Integer> getLocalBucketSet(Region<K, V> region) { if (region.getAttributes().getPartitionAttributes() != null) { return getPRBucketSet((PartitionedRegion)region); } return null; }
@Override protected boolean usesDiskStore(RegionAttributes ra) { if (ra.getPartitionAttributes().getLocalMaxMemory() <= 0) return false; // see bug 42055 return super.usesDiskStore(ra); }
@Override protected boolean usesDiskStore(RegionAttributes ra) { if (ra.getPartitionAttributes().getLocalMaxMemory() == 0) return false; // see bug 42055 return super.usesDiskStore(ra); }
protected static boolean isLocalAccessor(CacheDistributionAdvisee region) { if (!region.getAttributes().getDataPolicy().withStorage()) { return true; } if (region.getAttributes().getPartitionAttributes() != null && region.getAttributes().getPartitionAttributes() .getLocalMaxMemory() == 0) { return true; } return false; }
public final void setMasterTable(String masterTable) { this.masterTable = masterTable; if (this.masterTable != null) { final Region<?, ?> masterRegion = Misc.getRegionByPath(this.masterTable, true); this.masterResolver = (GfxdPartitionResolver)masterRegion.getAttributes() .getPartitionAttributes().getPartitionResolver(); } }
/** * Returns true if the underlying region is partitioned and has redundancy. * * @return true if region is partitioned and redundant. */ public final boolean isRedundant() { if (this.regionAttributes.getDataPolicy().withPartitioning()) { return this.regionAttributes.getPartitionAttributes() .getRedundantCopies() > 0; } return false; }
public final void setMasterTable(String masterTable) { this.masterTable = masterTable; if (this.masterTable != null) { final Region<?, ?> masterRegion = Misc.getRegionByPath(this.masterTable, true); this.masterResolver = (GfxdPartitionResolver)masterRegion.getAttributes() .getPartitionAttributes().getPartitionResolver(); } }
/** * Returns true if the underlying region is partitioned and has redundancy. * * @return true if region is partitioned and redundant. */ public final boolean isRedundant() { if (this.regionAttributes.getDataPolicy().withPartitioning()) { return this.regionAttributes.getPartitionAttributes() .getRedundantCopies() > 0; } return false; }
public final void setMasterTable(String masterTable) { this.masterTable = masterTable; if (this.masterTable != null) { final Region<?, ?> masterRegion = Misc.getRegionByPath(this.masterTable, true); this.masterResolver = (GfxdPartitionResolver)masterRegion.getAttributes() .getPartitionAttributes().getPartitionResolver(); } }
private int getPrID(final Optimizable opt) throws StandardException { assert opt != null: "opt is not expected to be null"; final Optimizable tab = opt.getBaseTable(); assert tab != null: "tab is not expected to be null"; Region<?, ?> r = tab.getTableDescriptor().getRegion(); if (r.getAttributes().getPartitionAttributes() != null) { return ((PartitionedRegion)r).getPRId(); } return -1; }
public static void HydraTask_validatePR() { int redundantCopies = testInstance.aRegion.getAttributes().getPartitionAttributes().getRedundantCopies(); ParRegUtil.verifyPRMetaData(testInstance.aRegion); ParRegUtil.verifyPrimaries(testInstance.aRegion, redundantCopies); ParRegUtil.verifyBucketCopies(testInstance.aRegion, redundantCopies); }
public Object call() { Cache cache = getCache(); Region region = cache.getRegion(regionName); TestPartitionListener listener = (TestPartitionListener) region.getAttributes().getPartitionAttributes().getPartitionListeners()[0]; return listener.getBucketsAndKeysRemoved(); } };
public Object call() { Cache cache = getCache(); Region region = cache.getRegion(regionName); TestPartitionListener listener = (TestPartitionListener) region.getAttributes().getPartitionAttributes().getPartitionListeners()[0]; return listener.getBucketsAndKeysAdded(); } };
private int getPrID(final Optimizable opt) throws StandardException { assert opt != null: "opt is not expected to be null"; final Optimizable tab = opt.getBaseTable(); assert tab != null: "tab is not expected to be null"; Region<?, ?> r = tab.getTableDescriptor().getRegion(); if (r.getAttributes().getPartitionAttributes() != null) { return ((PartitionedRegion)r).getPRId(); } return -1; }
public void testPartitionedRegionAttributesForCoLocation2(){ closeCache(); setXmlFile(findFile("coLocation.xml")); Cache c = getCache(); assertNotNull(c); Region cust = c.getRegion(Region.SEPARATOR+"Customer"); assertNotNull(cust); Region order = c.getRegion(Region.SEPARATOR+"Order"); assertNotNull(order); assertTrue(cust.getAttributes().getPartitionAttributes().getColocatedWith()==null); assertTrue(order.getAttributes().getPartitionAttributes().getColocatedWith().equals("Customer")); }
/** Verify primaries on all PRs. */ public static void HydraTask_verifyPrimaries() { long verifyController = ResourceManBB.getBB().getSharedCounters().incrementAndRead(ResourceManBB.verifyController2); if (verifyController == 1) { for (Region aRegion : testInstance.regionList) { Log.getLogWriter().info("Verifying " + aRegion.getFullPath()); int redundantCopies = aRegion.getAttributes().getPartitionAttributes().getRedundantCopies(); ParRegUtil.verifyPrimaries(aRegion, redundantCopies); } } }
/** Run validation on the PR after recovery (the PR must contain data) */ public static void validateAfterRecovery(Region reg) { Log.getLogWriter().info(reg.getFullPath() + " size is " + reg.size()); if (reg.size() == 0) { throw new TestException("Expected " + reg.getFullPath() + " to have a size > 0, but it has size " + reg.size()); } int redundantCopies = reg.getAttributes().getPartitionAttributes().getRedundantCopies(); ParRegUtil.verifyPRMetaData(reg); ParRegUtil.verifyPrimaries(reg, redundantCopies); ParRegUtil.verifyBucketCopies(reg, redundantCopies); }