/** * @param returnDestroyedRegion * if true, okay to return a destroyed region */ public Region getRegion(String path, boolean returnDestroyedRegion) { return getRegion(path, returnDestroyedRegion, false); }
public LocalRegion getRegion() { // The region will be null mostly for the other node where the gateway event // is serialized final GemFireCacheImpl cache; return this._region != null ? this._region : (this._region = ((cache = GemFireCacheImpl.getInstance()) != null ? (LocalRegion)cache.getRegion(this._regionName) : null)); }
/** * return the cq/interest information for a given region name, creating one if it doesn't exist */ public FilterProfile getFilterProfile(String regionName) { LocalRegion r = (LocalRegion) getRegion(regionName, true); if (r != null) { return r.getFilterProfile(); } return null; }
/** * return the cq/interest information for a given region name, creating one if it doesn't exist */ public FilterProfile getFilterProfile(String regionName) { LocalRegion r = (LocalRegion) getRegion(regionName, true); if (r != null) { return r.getFilterProfile(); } return null; }
public static <K, V> PartitionedRegion getReservoirRegionForSampleTable(String reservoirRegionName) { if (reservoirRegionName != null) { GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); Region<K, V> childRegion = cache.getRegion(reservoirRegionName); if (childRegion != null) { return (PartitionedRegion) childRegion; } } return null; }
private Set<InternalDistributedMember> getAllRecipients( GemFireCacheImpl cache, Map map) { Set recipients = new THashSet(); for (Object pr : map.keySet()) { recipients.addAll(((PartitionedRegion)(cache.getRegion((String)pr))) .getRegionAdvisor().adviseDataStore()); } return recipients; }
public Object call() throws Exception { Region r = PartitionRegionHelper.getLocalData(getGemfireCache().getRegion(CUSTOMER)); Iterator it = r.keySet().iterator(); while (it.hasNext()) { if (it.next().equals(new CustId(6))) { return 1; } } return 0; } });
private Set<InternalDistributedMember> getAllRecipients( GemFireCacheImpl cache, Map map) { Set recipients = new ObjectOpenHashSet(); for (Object pr : map.keySet()) { recipients.addAll(((PartitionedRegion)(cache.getRegion((String)pr))) .getRegionAdvisor().adviseDataStore()); } return recipients; }
public static void doPuts() { Region region = GemFireCacheImpl.getInstance().getRegion(SecurityTestUtil.regionName); region.put("key1", "value1"); region.put("key2", "value2"); }
public Object call() { GemFireCacheImpl cache = (GemFireCacheImpl) getCache(); PartitionedRegion region = (PartitionedRegion) cache.getRegion("region1"); long size = region.getDataStore().getBucketSize(0); TestDelta value = (TestDelta) region.get(Integer.valueOf(0)); value.checkFields(serializations, deserializations, deltas, clones); return Long.valueOf(size); } };
public static void verifyDeltaFailuresInC2S() { CachePerfStats stats = ((DistributedRegion)GemFireCacheImpl.getInstance() .getRegion(regionName + 0)).getCachePerfStats(); if (stats.getDeltaFailedUpdates() == 0) { throw new TestException( "CachePerfStats indicating failed delta updates is expected to be non-zero."); } }
public void run() { GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); getLogWriter().info("Closing Dist Region"); Region region = cache.getRegion(regionPath); region.close(); } };
public static void verifyDeltaFailuresInP2P() { CachePerfStats stats = ((DistributedRegion)GemFireCacheImpl.getInstance() .getRegion(regionName + 0)).getCachePerfStats(); if (stats.getDeltaFailedUpdates() == 0) { throw new TestException( "CachePerfStats indicating failed delta updates is expected to be non-zero."); } }
/** Return true if this region is initializing */ final boolean isGlobalRegionInitializing(String fullPath) { stopper.checkCancelInProgress(null); int oldLevel = LocalRegion.setThreadInitLevelRequirement(LocalRegion.ANY_INIT); // go through // initialization // latches try { return isGlobalRegionInitializing((LocalRegion) getRegion(fullPath)); } finally { LocalRegion.setThreadInitLevelRequirement(oldLevel); } }
public Object call() throws Exception { PartitionedRegion custRegion = (PartitionedRegion)getGemfireCache().getRegion(CUSTOMER); Set<BucketRegion> bucketSet = custRegion.getDataStore().getAllLocalPrimaryBucketRegions(); int count = 0; for (BucketRegion br : bucketSet) { count += br.size(); } return count; } });
public Object call() throws Exception { FunctionService.onRegion(getGemfireCache().getRegion(CUSTOMER)).withArgs(type) .execute(IteratorFunction.id).getResult(); return null; } });
public void run() { GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); SystemManagementService service = (SystemManagementService) getManagementService(); Region region = cache.getRegion(parentRegionPath); getLogWriter().info("Creating Sub Region"); region.createSubregion(subregionName, region.getAttributes()); } };
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 testPARTITION_PERSISTENT() throws CacheException { CacheCreation cache = new CacheCreation(); RegionCreation root = (RegionCreation) cache.createRegion("ppartition", "PARTITION_PERSISTENT"); testXml(cache); GemFireCacheImpl c = (GemFireCacheImpl) getCache(); Region r = c.getRegion("ppartition"); assertNotNull(r); RegionAttributes ra = r.getAttributes(); assertEquals(DataPolicy.PERSISTENT_PARTITION, ra.getDataPolicy()); assertNotNull(ra.getPartitionAttributes()); assertEquals(0, ra.getPartitionAttributes().getRedundantCopies()); } public void testPARTITION_REDUNDANT_PERSISTENT() throws CacheException {