@Override protected Cache createCache(InternalDistributedSystem system, Map<String, Object> options) { // Cache is already created for GemFireXD Cache cache = CacheFactory.getInstance(system); return cache; }
/** * @throws com.gemstone.gemfire.cache.CacheRuntimeException if no cache created */ protected Region getRegion(DistributedSystem sys) { Cache cache = CacheFactory.getInstance(sys); return cache.getRegion(this.regionName); }
/** * @throws com.gemstone.gemfire.cache.CacheRuntimeException if no cache created */ protected Region getRegion(DistributedSystem sys) { Cache cache = CacheFactory.getInstance(sys); return cache.getRegion(this.regionName); }
public static void invokeRegionEntryDestroy() { int noOfEntity = conftab.intAt(RecyclePrms.numberOfEntitiesInRegion, 0); Cache cache = CacheFactory.getInstance(DistributedSystemHelper.getDistributedSystem()); Object[] regionList = cache.rootRegions().toArray(); int numRegs = regionList.length; for (int i = 0; i < numRegs; i++) { Region reg = (Region)regionList[i]; if (!(reg instanceof HARegion)) { Set keys = reg.keySet(); if(keys.size() > noOfEntity) { Iterator ite=keys.iterator(); int count = keys.size() - noOfEntity ; for (int j = 0; ite.hasNext() && j < count ; j++ ) reg.destroy(ite.next()); } } } }
public static void invokeCacheMiss() { Cache cache = CacheFactory.getInstance(DistributedSystemHelper.getDistributedSystem()); Object[] regionList = cache.rootRegions().toArray(); int numRegs = regionList.length; for (int i = 0; i < numRegs; i++) { Region reg = (Region)regionList[i]; if (!(reg instanceof HARegion)) { int keysize = reg.keySet().size(); for (int j = 0; j < keysize; j++) reg.get("notexist" + j); } } }
public static void invokeRegionEntryGet() { int noOfEntity = conftab.intAt(RecyclePrms.numberOfEntitiesInRegion, 0); Cache cache = CacheFactory.getInstance(DistributedSystemHelper.getDistributedSystem()); Object[] regionList = cache.rootRegions().toArray(); int numRegs = regionList.length; for (int i = 0; i < numRegs; i++) { Region reg = (Region)regionList[i]; if (!(reg instanceof HARegion)) { Set keys = reg.keySet(); Iterator ite=keys.iterator(); for (int j = 0; ite.hasNext() && j < noOfEntity ; j++ ) reg.get(ite.next()); } } }
public static void invokeRegionEntryPut() { int noOfEntity = conftab.intAt(RecyclePrms.numberOfEntitiesInRegion, 0); Cache cache = CacheFactory.getInstance(DistributedSystemHelper.getDistributedSystem()); Object[] regionList = cache.rootRegions().toArray(); int numRegs = regionList.length; for (int i = 0; i < numRegs; i++) { Region reg = (Region)regionList[i]; if (!(reg instanceof HARegion)) { Set keys = reg.keySet(); Iterator ite=keys.iterator(); for (int j = 0; ite.hasNext() && j < noOfEntity ; j++ ) { Object key = ite.next(); reg.put(key,key); } } } }
public static void invokeRegionEntryInvalidate() { int noOfEntity = conftab.intAt(RecyclePrms.numberOfEntitiesInRegion, 0); Cache cache = CacheFactory.getInstance(DistributedSystemHelper .getDistributedSystem()); Object[] regionList = cache.rootRegions().toArray(); int numRegs = regionList.length; for (int i = 0; i < numRegs; i++) { Region reg = (Region)regionList[i]; if (!(reg instanceof HARegion)) { Set keys = reg.keySet(); Iterator ite = keys.iterator(); for (int j = 0; ite.hasNext() && j < noOfEntity; j++) { Object key = ite.next(); reg.invalidate(key); } } } }
/** * Returns the QueryService, that can be used to execute Query functions on * the servers associated with this pool. * @return the QueryService */ public QueryService getQueryService() { Cache cache = CacheFactory.getInstance(InternalDistributedSystem.getAnyInstance()); DefaultQueryService queryService = new DefaultQueryService(cache); queryService.setPool(this); return queryService; }
protected LocalRegion getLocalRegionForProcessing(DistributionManager dm) { Assert.assertTrue(this.regionPath != null, "regionPath was null"); GemFireCacheImpl gfc = (GemFireCacheImpl)CacheFactory.getInstance(dm.getSystem()); return gfc.getRegionByPathForProcessing(this.regionPath); }
/** * Returns the QueryService, that can be used to execute Query functions on * the servers associated with this pool. * @return the QueryService */ public QueryService getQueryService() { Cache cache = CacheFactory.getInstance(InternalDistributedSystem.getAnyInstance()); DefaultQueryService queryService = new DefaultQueryService((InternalCache) cache); queryService.setPool(this); return queryService; }
public static void invokeRegionEntryMiss() { int noOfEntity = conftab.intAt(RecyclePrms.numberOfEntitiesInRegion, 0); Cache cache = CacheFactory.getInstance(DistributedSystemHelper.getDistributedSystem()); Object[] regionList = cache.rootRegions().toArray(); int numRegs = regionList.length; for (int i = 0; i < numRegs; i++) { Region reg = (Region)regionList[i]; if (!(reg instanceof HARegion)) { int count = reg.keySet().size() - noOfEntity; for (int j = 0; j < count ; j++ ) reg.get("notexist"+j); } } }
/** * Creates a new <code>CacheHealthEvaluator</code> */ CacheHealthEvaluator(GemFireHealthConfig config, DM dm) { super(config, dm); this.config = config; InternalDistributedSystem system = dm.getSystem(); GemFireCacheImpl cache; try { cache = (GemFireCacheImpl) CacheFactory.getInstance(system); } catch (CancelException ex) { // No cache in this VM cache = null; } initialize(cache, dm); GemFireCacheImpl.addCacheLifecycleListener(this); }
/** * Creates a new <code>CacheHealthEvaluator</code> */ CacheHealthEvaluator(GemFireHealthConfig config, DM dm) { super(config, dm); this.config = config; InternalDistributedSystem system = dm.getSystem(); GemFireCacheImpl cache; try { cache = (GemFireCacheImpl) CacheFactory.getInstance(system); } catch (CancelException ex) { // No cache in this VM cache = null; } initialize(cache, dm); GemFireCacheImpl.addCacheLifecycleListener(this); }
/** * @throws com.gemstone.gemfire.cache.CacheRuntimeException if no cache created */ protected Region getRegion(DistributedSystem sys) { Cache cache = CacheFactory.getInstance(sys); Region r = cache.getRegion(regionName); if (r == null) { throw new RegionNotFoundException(LocalizedStrings.RegionAdminRequest_REGION_0_NOT_FOUND_IN_REMOTE_CACHE_1.toLocalizedString(new Object[] {regionName, cache.getName()})); } return r; }
/** * @throws com.gemstone.gemfire.cache.CacheRuntimeException if no cache created */ protected Region getRegion(DistributedSystem sys) { Cache cache = CacheFactory.getInstance(sys); Region r = cache.getRegion(regionName); if (r == null) { throw new RegionNotFoundException(LocalizedStrings.RegionAdminRequest_REGION_0_NOT_FOUND_IN_REMOTE_CACHE_1.toLocalizedString(new Object[] {regionName, cache.getName()})); } return r; }
/** * Returns a <code>FetchSysCfgResponse</code> that will be returned to the * specified recipient. The message will contains a copy of the local * manager's config. */ public static RefreshMemberSnapshotResponse create(DistributionManager dm, InternalDistributedMember recipient) { RefreshMemberSnapshotResponse m = new RefreshMemberSnapshotResponse(); m.setRecipient(recipient); try { DistributedSystem sys = dm.getSystem(); GemFireCacheImpl c = (GemFireCacheImpl)CacheFactory.getInstance(sys); m.snapshot = new GemFireMemberStatus(c); } catch (Exception ex) { m.snapshot = null; } return m; }
public void populateSnapshot(DistributionManager dm) { if (cancelled) return; DistributedSystem sys = dm.getSystem(); GemFireCacheImpl cache = (GemFireCacheImpl)CacheFactory.getInstance(sys); if (cancelled) return; RegionSubRegionSnapshot root = new RegionSubRegionSnapshot(); /* This root exists only on admin side as a root of all root-region just to * create a tree-like structure */ root.setName("Root"); root.setParent(null); root.setEntryCount(0); Set rootRegions = cache.rootRegions(); this.snapshot = root; populateRegionSubRegions(root, rootRegions, cache); }
public void populateSnapshot(DistributionManager dm) { if (cancelled) return; DistributedSystem sys = dm.getSystem(); GemFireCacheImpl cache = (GemFireCacheImpl)CacheFactory.getInstance(sys); if (cancelled) return; RegionSubRegionSnapshot root = new RegionSubRegionSnapshot(); /* This root exists only on admin side as a root of all root-region just to * create a tree-like structure */ root.setName("Root"); root.setParent(null); root.setEntryCount(0); Set rootRegions = cache.rootRegions(); this.snapshot = root; populateRegionSubRegions(root, rootRegions, cache); }
private Region getARegion() throws Exception { DistributedSystem ds = DistributedSystem.connect( sysProps ); Cache c = null; try { c = CacheFactory.create( ds ); } catch ( CacheExistsException cee ) { c = CacheFactory.getInstance( ds ); } AttributesFactory af = new AttributesFactory(); Region root = c.getRegion("root"); if ( root == null ) { root = c.createRegion("root", af.create() ); } Region sub = root.createSubregion( myTestName, af.create() ); return sub; }