@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); }
public void run2() throws CacheException { for (int i = 0; i< regions.length ; i++) { Region region = getRootRegion().getSubregion(regions[i]); assertEquals("The region should be configure with local max memory zero : " + region, region.getAttributes().getPartitionAttributes() .getLocalMaxMemory(), 0); } } });
public void run2() throws CacheException { for (int i = 0; i< regions.length ; i++) { Region region = getRootRegion().getSubregion(regions[i]); assertEquals("The region should be configure with local max memory zero : " + region, region.getAttributes().getPartitionAttributes() .getLocalMaxMemory(), 0); } } });
public final boolean isAccessorForRegion() { final LocalRegion r = this.region; if (r != null) { if (r.getPartitionAttributes() != null) { return r.getPartitionAttributes().getLocalMaxMemory() == 0; } else { return !r.getDataPolicy().withStorage(); } } return false; }
public final boolean isAccessorForRegion() { final LocalRegion r = this.region; if (r != null) { if (r.getPartitionAttributes() != null) { return r.getPartitionAttributes().getLocalMaxMemory() == 0; } else { return !r.getDataPolicy().withStorage(); } } return false; }
public final boolean isAccessorForRegion() { final LocalRegion r = this.region; if (r != null) { if (r.getPartitionAttributes() != null) { return r.getPartitionAttributes().getLocalMaxMemory() == 0; } else { return !r.getDataPolicy().withStorage(); } } return false; }
/** * Resets the partition description based on partition attributes, to pick up * product defaults and side-effects. */ private static void resetPartitionDescription(PartitionDescription pd, PartitionAttributes pa) { if (pd.getLocalMaxMemory() != null) { pd.setLocalMaxMemory(new Integer(pa.getLocalMaxMemory())); } // else deferred pd.setRecoveryDelay(new Long(pa.getRecoveryDelay())); pd.setRedundantCopies(new Integer(pa.getRedundantCopies())); pd.setStartupRecoveryDelay(new Long(pa.getStartupRecoveryDelay())); pd.setTotalMaxMemory(new Long(pa.getTotalMaxMemory())); pd.setTotalNumBuckets(new Integer(pa.getTotalNumBuckets())); }
public Object load(LoaderHelper helper) throws CacheLoaderException { /* checking the attributes set in xml file. */ PartitionedRegion pr = (PartitionedRegion) helper.getRegion(); if (pr.getAttributes().getPartitionAttributes().getRedundantCopies() != 1) Assert .fail("Redundancy of the partition region is not 1"); Assert.assertEquals( pr.getAttributes().getPartitionAttributes().getLocalMaxMemory(), 200); /* * Returning the same key. This is to check CaccheLoader is invoked or * not */ return helper.getKey(); }
/** * Can this table contain any data locally? */ public final boolean isDataStore() { return this.region != null && this.region.getDataPolicy().withStorage() && (!this.region.getDataPolicy().withPartitioning() || this.region .getPartitionAttributes().getLocalMaxMemory() != 0); }
/** * Can this table contain any data locally? */ public final boolean isDataStore() { return this.region != null && this.region.getDataPolicy().withStorage() && (!this.region.getDataPolicy().withPartitioning() || this.region .getPartitionAttributes().getLocalMaxMemory() != 0); }
/** * Can this table contain any data locally? */ public final boolean isDataStore() { return this.region != null && this.region.getDataPolicy().withStorage() && (!this.region.getDataPolicy().withPartitioning() || this.region .getPartitionAttributes().getLocalMaxMemory() != 0); }
public void run2() throws CacheException { Cache cache = getCache(); AttributesFactory attr = new AttributesFactory(); attr.setDataPolicy(DataPolicy.PARTITION); RegionAttributes regionAttribs = attr.create(); Region partitionedregion = cache.createRegion(rName, regionAttribs); assertNotNull(partitionedregion); assertNotNull(cache.getRegion(rName)); PartitionAttributes p = regionAttribs.getPartitionAttributes(); int maxMem = p.getLocalMaxMemory(); assertTrue("LocalMaxMemory is zero", maxMem != 0); } };
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; }
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; }
protected static boolean getIsDataStore() { if (testInstance.aRegion == null) { throw new TestException("aRegion is null"); } PartitionAttributes prAttr = testInstance.aRegion.getAttributes().getPartitionAttributes(); boolean result = false; if (prAttr == null) { result = false; } else { result = prAttr.getLocalMaxMemory() != 0; } ParRegBB.getBB().getSharedMap().put(isDataStoreKey + RemoteTestModule.getMyVmid(), result); return result; }
public void testPARTITION_PROXY_REDUNDANT() throws CacheException { CacheCreation cache = new CacheCreation(); RegionCreation root = (RegionCreation) cache.createRegion("rpartitionProxy", "PARTITION_PROXY_REDUNDANT"); testXml(cache); GemFireCacheImpl c = (GemFireCacheImpl) getCache(); Region r = c.getRegion("rpartitionProxy"); assertNotNull(r); RegionAttributes ra = r.getAttributes(); assertEquals(DataPolicy.PARTITION, ra.getDataPolicy()); assertNotNull(ra.getPartitionAttributes()); assertEquals(1, ra.getPartitionAttributes().getRedundantCopies()); assertEquals(0, ra.getPartitionAttributes().getLocalMaxMemory()); } public void testREPLICATE_PROXY() throws CacheException {
public void testPARTITION_PROXY() throws CacheException { CacheCreation cache = new CacheCreation(); RegionCreation root = (RegionCreation) cache.createRegion("partitionProxy", "PARTITION_PROXY"); testXml(cache); GemFireCacheImpl c = (GemFireCacheImpl) getCache(); Region r = c.getRegion("partitionProxy"); assertNotNull(r); RegionAttributes ra = r.getAttributes(); assertEquals(DataPolicy.PARTITION, ra.getDataPolicy()); assertNotNull(ra.getPartitionAttributes()); assertEquals(0, ra.getPartitionAttributes().getRedundantCopies()); assertEquals(0, ra.getPartitionAttributes().getLocalMaxMemory()); } public void testPARTITION_PROXY_REDUNDANT() throws CacheException {
@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()); }
@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()); }