@Test public void createVMRegionWithInternalRegionThrows() throws Exception { assertThatThrownBy(() -> { cache.createVMRegion(null, null, new InternalRegionArguments().setInternalRegion(true)); }).isInstanceOf(NotAuthorizedException.class); }
new InternalRegionArguments().setInternalMetaRegion(meta).setDestroyLockFlag(true) .setSnapshotInputStream(null).setImageTarget(null) .setIsUsedForSerialGatewaySenderQueue(true).setInternalRegion(true) .setSerialGatewaySender(sender));
/** * * 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 RegionExistsException if a region of the same name exists in the same Cache */ public static HARegion getInstance(String regionName, InternalCache 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).setInternalRegion(true).setImageTarget(null)); return (HARegion) region; }
@Test public void startingWithDoubleUnderscoreIsOkForInternalRegion() { InternalRegionArguments internalRegionArguments = new InternalRegionArguments(); internalRegionArguments.setInternalRegion(true); assertThatCode(() -> validate("__ValidInternalRegionName", internalRegionArguments)) .doesNotThrowAnyException(); }
private Region<String, RegionConfiguration> createRegionConfigurationMetadataRegion() { // a sessionFactory in hibernate could have been re-started // so, it is possible that this region exists already Region<String, RegionConfiguration> r = this.cache.getRegion(REGION_CONFIGURATION_METADATA_REGION); if (r != null) { return r; } GemFireCacheImpl gemFireCache = (GemFireCacheImpl) cache; InternalRegionArguments ira = new InternalRegionArguments().setInternalRegion(true); AttributesFactory af = new AttributesFactory(); af.setDataPolicy(DataPolicy.REPLICATE); af.setScope(Scope.DISTRIBUTED_ACK); af.addCacheListener(new RegionConfigurationCacheListener()); RegionAttributes ra = af.create(); try { return gemFireCache.createVMRegion(REGION_CONFIGURATION_METADATA_REGION, ra, ira); } catch (IOException | ClassNotFoundException e) { InternalGemFireError assErr = new InternalGemFireError( "unexpected exception"); assErr.initCause(e); throw assErr; } }
root = (DistributedRegion) cache.createVMRegion(PR_ROOT_REGION_NAME, ra, new InternalRegionArguments().setIsUsedForPartitionedRegionAdmin(true) .setInternalRegion(true).setCachePerfStatsHolder(prMetaStatsHolder)); root.getDistributionAdvisor().addMembershipListener(new MemberFailureListener(cache)); } catch (RegionExistsException ignore) {
prQ = (PartitionedRegion) cache.createVMRegion(prQName, ra, new InternalRegionArguments().setInternalMetaRegion(meta).setDestroyLockFlag(true) .setInternalRegion(true).setSnapshotInputStream(null).setImageTarget(null));
af.setDataPolicy(DataPolicy.REPLICATE); InternalRegionArguments ira = new InternalRegionArguments().setInternalRegion(true).setIsUsedForMetaRegion(true); redisMetaData = gemFireCache.createVMRegion(REDIS_META_DATA_REGION, af.create(), ira);
if (this.dynamicRegionList == null) { InternalRegionArguments ira = new InternalRegionArguments().setDestroyLockFlag(true) .setInternalRegion(true).setSnapshotInputStream(null).setImageTarget(null); AttributesFactory af = new AttributesFactory(); if (this.config.getPersistBackup()) {
private Region<String, RegionConfiguration> createRegionConfigurationMetadataRegion() { // a sessionFactory in hibernate could have been re-started // so, it is possible that this region exists already Region<String, RegionConfiguration> r = this.cache.getRegion(REGION_CONFIGURATION_METADATA_REGION); if (r != null) { return r; } GemFireCacheImpl gemFireCache = (GemFireCacheImpl) cache; InternalRegionArguments ira = new InternalRegionArguments().setInternalRegion(true); AttributesFactory af = new AttributesFactory(); af.setScope(Scope.LOCAL); af.addCacheListener(new RegionConfigurationCacheListener()); RegionAttributes ra = af.create(); try { return gemFireCache.createVMRegion(REGION_CONFIGURATION_METADATA_REGION, ra, ira); } catch (IOException | ClassNotFoundException e) { InternalGemFireError assErr = new InternalGemFireError( LocalizedStrings.GemFireCache_UNEXPECTED_EXCEPTION.toLocalizedString()); assErr.initCause(e); throw assErr; } }