public Object load(LoaderHelper helper) throws CacheLoaderException { if(helper.getRegion().getAttributes().getScope().equals(Scope.DISTRIBUTED_ACK)) { System.err.println("Doing a net search for " + helper.getKey()); Object result = helper.netSearch(false); System.err.println("Net search found " + result); if(result != null) { return result; } } Object key = helper.getKey(); return message + "-" + key; }
public void run() { try { Region region = createRegion(name, "INCOMPATIBLE_ROOT", getRegionAttributes()); assertTrue(getRootRegion("INCOMPATIBLE_ROOT").getAttributes().getScope().isDistributedNoAck()); assertTrue(region.getAttributes().getScope().isDistributedNoAck()); } catch (CacheException ex) { fail("While creating NO ACK region", ex); } } });
public void run2() throws CacheException { Cache cache2 = getCache(); Region region2 = cache2.getRegion(name); assertNotNull(region2); RegionAttributes attrs2 = region2.getAttributes(); assertEquals(name, region2.getName()); assertEquals(Scope.LOCAL, attrs2.getScope()); assertEquals(String.class, attrs2.getKeyConstraint()); } });
/** * This implementation only checks readiness and scope */ public Lock getRegionDistributedLock() throws IllegalStateException { checkReadiness(); checkForLimitedOrNoAccess(); Scope theScope = getAttributes().getScope(); Assert.assertTrue(theScope == Scope.LOCAL); throw new IllegalStateException(LocalizedStrings.LocalRegion_ONLY_SUPPORTED_FOR_GLOBAL_SCOPE_NOT_LOCAL.toLocalizedString()); }
/** * This implementation only checks readiness and scope */ public Lock getRegionDistributedLock() throws IllegalStateException { checkReadiness(); checkForLimitedOrNoAccess(); Scope theScope = getAttributes().getScope(); Assert.assertTrue(theScope == Scope.LOCAL); throw new IllegalStateException(LocalizedStrings.LocalRegion_ONLY_SUPPORTED_FOR_GLOBAL_SCOPE_NOT_LOCAL.toLocalizedString()); }
/** * This implementation only checks readiness and scope */ public Lock getDistributedLock(Object key) throws IllegalStateException { checkReadiness(); checkForLimitedOrNoAccess(); Scope theScope = getAttributes().getScope(); Assert.assertTrue(theScope == Scope.LOCAL); throw new IllegalStateException(LocalizedStrings.LocalRegion_ONLY_SUPPORTED_FOR_GLOBAL_SCOPE_NOT_LOCAL.toLocalizedString()); }
/** * This implementation only checks readiness and scope */ public Lock getDistributedLock(Object key) throws IllegalStateException { checkReadiness(); checkForLimitedOrNoAccess(); Scope theScope = getAttributes().getScope(); Assert.assertTrue(theScope == Scope.LOCAL); throw new IllegalStateException(LocalizedStrings.LocalRegion_ONLY_SUPPORTED_FOR_GLOBAL_SCOPE_NOT_LOCAL.toLocalizedString()); }
/************** Public Methods ************************/ Object doNetSearch() throws TimeoutException { resetResults(); RegionAttributes attrs = region.getAttributes(); this.requestInProgress=true; Scope scope = attrs.getScope(); Assert.assertTrue(scope != Scope.LOCAL); netSearchForBlob(); this.requestInProgress=false; return this.result; }
/************** Public Methods ************************/ Object doNetSearch() throws TimeoutException { resetResults(); RegionAttributes attrs = region.getAttributes(); this.requestInProgress=true; Scope scope = attrs.getScope(); Assert.assertTrue(scope != Scope.LOCAL); netSearchForBlob(); this.requestInProgress=false; return this.result; }
static void initEvictTest(Region workRegion) { Scope scope = workRegion.getAttributes().getScope(); scopeIsLocal = scope.isLocal(); Log.getLogWriter().info("Setting scopeIsLocal to " + scopeIsLocal + ", scope is " + scope); }
private void handleException(String string, Exception e, Region r) { if ((HydraUtil.isConcurrentTest() && e instanceof RegionDestroyedException)) { logInfo(string + " RegionDestroy expected during concurrent test. Contnuing test "); } if (e instanceof RegionDestroyedException && !r.getAttributes().getScope().equals(Scope.LOCAL)) { // region destroy is propogated to this jvm logInfo(string + " Region is already destroyed probably due to remote destroy, continuing with test"); removeAvailableRegion(r); } else { throw new TestException(string, e); } }
public void run() { try { createRegion(name, "INCOMPATIBLE_ROOT", getRegionAttributes()); } catch (CacheException ex) { fail("While creating GLOBAL region", ex); } assertTrue(getRootRegion("INCOMPATIBLE_ROOT").getAttributes().getScope().isGlobal()); } });
private void initTableFlags() { setFlag(HAS_BUCKET_ROWLOC, isPartitioned()); setFlag(FOR_APPTABLE, !this.isLocalIndex() && !this.regionAttributes.getScope().isLocal() && !this.isGlobalIndex()); setFlag(FOR_APPTABLE_OR_GLOBAL_INDEX, !this.isLocalIndex() && !this.regionAttributes.getScope().isLocal()); final EvictionAttributes ea = this.regionAttributes.getEvictionAttributes(); setFlag(IS_OVERFLOW, ea != null && ea.getAction().equals(EvictionAction.OVERFLOW_TO_DISK)); }
protected void initialize() { RegionAttributes ratts = RegionHelper.getRegionAttributes(ConfigPrms.getRegionConfig()); isLocalScope = ratts.getScope().isLocal(); Log.getLogWriter().info("Test instance is " + this); }
private void initTableFlags() { setFlag(HAS_BUCKET_ROWLOC, isPartitioned()); setFlag(FOR_APPTABLE, !this.isLocalIndex() && !this.regionAttributes.getScope().isLocal() && !this.isGlobalIndex()); setFlag(FOR_APPTABLE_OR_GLOBAL_INDEX, !this.isLocalIndex() && !this.regionAttributes.getScope().isLocal()); final EvictionAttributes ea = this.regionAttributes.getEvictionAttributes(); setFlag(IS_OVERFLOW, ea != null && ea.getAction().equals(EvictionAction.OVERFLOW_TO_DISK)); }
private void initTableFlags() { setFlag(HAS_BUCKET_ROWLOC, isPartitioned()); setFlag(FOR_APPTABLE, !this.isLocalIndex() && !this.regionAttributes.getScope().isLocal() && !this.isGlobalIndex()); setFlag(FOR_APPTABLE_OR_GLOBAL_INDEX, !this.isLocalIndex() && !this.regionAttributes.getScope().isLocal()); final EvictionAttributes ea = this.regionAttributes.getEvictionAttributes(); setFlag(IS_OVERFLOW, ea != null && ea.getAction().equals(EvictionAction.OVERFLOW_TO_DISK)); }
public void testREPLICATE_PROXY() throws CacheException { CacheCreation cache = new CacheCreation(); RegionCreation root = (RegionCreation) cache.createRegion("replicateProxy", "REPLICATE_PROXY"); testXml(cache); GemFireCacheImpl c = (GemFireCacheImpl) getCache(); Region r = c.getRegion("replicateProxy"); assertNotNull(r); RegionAttributes ra = r.getAttributes(); assertEquals(DataPolicy.EMPTY, ra.getDataPolicy()); assertEquals(Scope.DISTRIBUTED_ACK, ra.getScope()); }
public void testREPLICATE() throws CacheException { CacheCreation cache = new CacheCreation(); RegionCreation root = (RegionCreation) cache.createRegion("replicate", "REPLICATE"); testXml(cache); GemFireCacheImpl c = (GemFireCacheImpl) getCache(); Region r = c.getRegion("replicate"); assertNotNull(r); RegionAttributes ra = r.getAttributes(); assertEquals(DataPolicy.REPLICATE, ra.getDataPolicy()); assertEquals(Scope.DISTRIBUTED_ACK, ra.getScope()); } public void testREPLICATE_PERSISTENT() throws CacheException {
public void testLOCAL() throws CacheException { CacheCreation cache = new CacheCreation(); RegionCreation root = (RegionCreation) cache.createRegion("local", "LOCAL"); testXml(cache); GemFireCacheImpl c = (GemFireCacheImpl) getCache(); Region r = c.getRegion("local"); assertNotNull(r); RegionAttributes ra = r.getAttributes(); assertEquals(DataPolicy.NORMAL, ra.getDataPolicy()); assertEquals(Scope.LOCAL, ra.getScope()); } public void testLOCAL_PERSISTENT() throws CacheException {
public void testLOCAL_PERSISTENT() throws CacheException { CacheCreation cache = new CacheCreation(); RegionCreation root = (RegionCreation) cache.createRegion("plocal", "LOCAL_PERSISTENT"); testXml(cache); GemFireCacheImpl c = (GemFireCacheImpl) getCache(); Region r = c.getRegion("plocal"); assertNotNull(r); RegionAttributes ra = r.getAttributes(); assertEquals(DataPolicy.PERSISTENT_REPLICATE, ra.getDataPolicy()); assertEquals(Scope.LOCAL, ra.getScope()); } public void testLOCAL_HEAP_LRU() throws CacheException {