@Override public void run2() { GemFireCacheImpl gfc = (GemFireCacheImpl) getCache(); InternalRegionArguments ira = new InternalRegionArguments().setTestCallable(new TXTroubleMaker()); try { AttributesFactory af = new AttributesFactory(); af.setDataPolicy(DataPolicy.REPLICATE); af.setScope(Scope.DISTRIBUTED_ACK); gfc.createVMRegion(rgnName1, af.create(), ira); gfc.createVMRegion(rgnName2, af.create(), ira); } catch (IOException ioe) { fail(ioe.toString()); } catch (TimeoutException e) { fail(e.toString()); } catch (ClassNotFoundException e) { fail(e.toString()); } } };
cache.createVMRegion("__ParameterizedQueries__", regionAttributes, regionArguments); if (logger.isDebugEnabled()) { logger.debug("Successfully created __ParameterizedQueries__ region");
internalArgs.setMetaRegionWithTransactions(false); configRegion = cache.createVMRegion(CONFIG_REGION_NAME, regionAttrsFactory.create(), internalArgs);
/** * * Returns an instance of HARegion after it has properly initialized * * @param regionName * name of the region to be created * @param cache * the cache that owns this region * @param ra * attributes of the region * @return an instance of an HARegion * @throws TimeoutException * @throws RegionExistsException * if a region of the same name exists in the same Cache * @throws IOException * @throws ClassNotFoundException */ public static HARegion getInstance(String regionName, GemFireCacheImpl cache, HARegionQueue hrq, RegionAttributes ra) throws TimeoutException, RegionExistsException, IOException, ClassNotFoundException { HARegion haRegion = new HARegion(regionName, ra, null, cache); haRegion.setOwner(hrq); Region region = cache.createVMRegion(regionName, ra, new InternalRegionArguments().setInternalMetaRegion(haRegion) .setDestroyLockFlag(true).setSnapshotInputStream(null) .setImageTarget(null)); return (HARegion)region; }
/** * * Returns an instance of HARegion after it has properly initialized * * @param regionName * name of the region to be created * @param cache * the cache that owns this region * @param ra * attributes of the region * @return an instance of an HARegion * @throws TimeoutException * @throws RegionExistsException * if a region of the same name exists in the same Cache * @throws IOException * @throws ClassNotFoundException */ public static HARegion getInstance(String regionName, GemFireCacheImpl cache, HARegionQueue hrq, RegionAttributes ra) throws TimeoutException, RegionExistsException, IOException, ClassNotFoundException { HARegion haRegion = new HARegion(regionName, ra, null, cache); haRegion.setOwner(hrq); Region region = cache.createVMRegion(regionName, ra, new InternalRegionArguments().setInternalMetaRegion(haRegion) .setDestroyLockFlag(true).setSnapshotInputStream(null) .setImageTarget(null)); return (HARegion)region; }
region = ((GemFireCacheImpl) cache).createVMRegion(META_DATA_REGION_NAME, ra, ira); } catch (RegionExistsException e) { region = cache.getRegion(META_DATA_REGION_NAME);
._setLruList((new TestLRUClockHand(distRegion, ((AbstractLRURegionMap)distRegion.entries)._getCCHelper()))); ((GemFireCacheImpl)cache).createVMRegion(regionName, attr, new InternalRegionArguments().setInternalMetaRegion(distRegion) .setDestroyLockFlag(true).setSnapshotInputStream(null)
.createVMRegion(regionName, attr, new InternalRegionArguments() .setInternalMetaRegion(distRegion).setDestroyLockFlag(true) .setSnapshotInputStream(null).setImageTarget(null));
public Region basicCreateRegion(String name, RegionAttributes attrs) throws RegionExistsException, TimeoutException { try { InternalRegionArguments ira = new InternalRegionArguments().setDestroyLockFlag(true).setRecreateFlag(false) .setSnapshotInputStream(null).setImageTarget(null); if (attrs instanceof UserSpecifiedRegionAttributes) { ira.setIndexes(((UserSpecifiedRegionAttributes) attrs).getIndexes()); } return createVMRegion(name, attrs, ira); } catch (IOException e) { // only if loading snapshot, not here InternalGemFireError assErr = new InternalGemFireError(LocalizedStrings.GemFireCache_UNEXPECTED_EXCEPTION.toLocalizedString()); assErr.initCause(e); throw assErr; } catch (ClassNotFoundException e) { // only if loading snapshot, not here InternalGemFireError assErr = new InternalGemFireError(LocalizedStrings.GemFireCache_UNEXPECTED_EXCEPTION.toLocalizedString()); assErr.initCause(e); throw assErr; } }
public Region basicCreateRegion(String name, RegionAttributes attrs) throws RegionExistsException, TimeoutException { try { InternalRegionArguments ira = new InternalRegionArguments().setDestroyLockFlag(true).setRecreateFlag(false) .setSnapshotInputStream(null).setImageTarget(null); if (attrs instanceof UserSpecifiedRegionAttributes) { ira.setIndexes(((UserSpecifiedRegionAttributes) attrs).getIndexes()); } return createVMRegion(name, attrs, ira); } catch (IOException e) { // only if loading snapshot, not here InternalGemFireError assErr = new InternalGemFireError(LocalizedStrings.GemFireCache_UNEXPECTED_EXCEPTION.toLocalizedString()); assErr.initCause(e); throw assErr; } catch (ClassNotFoundException e) { // only if loading snapshot, not here InternalGemFireError assErr = new InternalGemFireError(LocalizedStrings.GemFireCache_UNEXPECTED_EXCEPTION.toLocalizedString()); assErr.initCause(e); throw assErr; } }
private Region createSnappySpecificGlobalCmdRegion(boolean isLead) throws IOException, ClassNotFoundException { GemFireCacheImpl cache = Misc.getGemFireCache(); final com.gemstone.gemfire.cache.AttributesFactory<?, ?> afact = new com.gemstone.gemfire.cache.AttributesFactory<>(); afact.setScope(Scope.DISTRIBUTED_ACK); if (!isLead) { afact.setInitialCapacity(1000); afact.setConcurrencyChecksEnabled(false); afact.setDiskSynchronous(true); afact.setDiskStoreName(GfxdConstants.GFXD_DD_DISKSTORE_NAME); afact.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); // overflow this region to disk as much as possible since we don't // need it to be in memory afact.setEvictionAttributes(EvictionAttributes.createLRUEntryAttributes( 1, EvictionAction.OVERFLOW_TO_DISK)); } else { afact.setDataPolicy(DataPolicy.REPLICATE); } InternalRegionArguments internalRegionArgs = new InternalRegionArguments(); return cache.createVMRegion("__snappyglobalcmds__", afact.create(), internalRegionArgs); }
newRegion = this.cache.createVMRegion(this.regionName, attrs, iargs);
newRegion = this.cache.createVMRegion(this.regionName, attrs, iargs);
cache.createVMRegion(regionName, attr, new InternalRegionArguments().setDestroyLockFlag(true) .setRecreateFlag(false).setSnapshotInputStream(null)
cache.createVMRegion(regionName, attr, new InternalRegionArguments().setDestroyLockFlag(true) .setRecreateFlag(false).setSnapshotInputStream(null)
/** * This method creates the client health monitoring region. * * @param cache * The current GemFire Cache * @guarded.By ClientHealthMonitoringRegion.class */ private static void initialize(GemFireCacheImpl cache) { try { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setEntryTimeToLive(new ExpirationAttributes( ADMIN_REGION_EXPIRY_INTERVAL, ExpirationAction.DESTROY)); cache.getLogger().fine("ClientHealthMonitoringRegion, setting TTL for entry...."); factory.addCacheListener(prepareCacheListener()); factory.setStatisticsEnabled(true); RegionAttributes regionAttrs = factory.create(); InternalRegionArguments internalArgs = new InternalRegionArguments(); internalArgs.setIsUsedForMetaRegion(true); internalArgs.setIsUsedForPartitionedRegionAdmin(false); currentInstance = cache.createVMRegion(ADMIN_REGION_NAME, regionAttrs, internalArgs); } catch (Exception ex) { cache.getLoggerI18n().error(LocalizedStrings. ClientHealthMonitoringRegion_ERROR_WHILE_CREATING_AN_ADMIN_REGION, ex); } }
/** * This method creates the client health monitoring region. * * @param cache * The current GemFire Cache * @guarded.By ClientHealthMonitoringRegion.class */ private static void initialize(GemFireCacheImpl cache) { try { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); factory.setEntryTimeToLive(new ExpirationAttributes( ADMIN_REGION_EXPIRY_INTERVAL, ExpirationAction.DESTROY)); cache.getLogger().fine("ClientHealthMonitoringRegion, setting TTL for entry...."); factory.addCacheListener(prepareCacheListener()); factory.setStatisticsEnabled(true); RegionAttributes regionAttrs = factory.create(); InternalRegionArguments internalArgs = new InternalRegionArguments(); internalArgs.setIsUsedForMetaRegion(true); internalArgs.setIsUsedForPartitionedRegionAdmin(false); currentInstance = cache.createVMRegion(ADMIN_REGION_NAME, regionAttrs, internalArgs); } catch (Exception ex) { cache.getLoggerI18n().error(LocalizedStrings. ClientHealthMonitoringRegion_ERROR_WHILE_CREATING_AN_ADMIN_REGION, ex); } }
.setIsUsedForMetaRegion(true).setIsUsedForPartitionedRegionAdmin(false); LocalRegion reg = (LocalRegion)cache.createVMRegion(qualifiedName, afact.create(), internalRegionArgs); return new GlobalIndexCacheWithLocalRegion(qualifiedName, reg);
.setIsUsedForMetaRegion(true).setIsUsedForPartitionedRegionAdmin(false); LocalRegion reg = (LocalRegion)cache.createVMRegion(qualifiedName, afact.create(), internalRegionArgs); return new GlobalIndexCacheWithLocalRegion(qualifiedName, reg);
.setIsUsedForMetaRegion(true).setIsUsedForPartitionedRegionAdmin(false); LocalRegion reg = (LocalRegion)cache.createVMRegion(qualifiedName, afact.create(), internalRegionArgs); return new GlobalIndexCacheWithLocalRegion(qualifiedName, reg);