@Test public void createVMRegionWithUsedForMetaRegionThrows() throws Exception { assertThatThrownBy(() -> { cache.createVMRegion(null, null, new InternalRegionArguments().setIsUsedForMetaRegion(true)); }).isInstanceOf(NotAuthorizedException.class); }
if (cache != null) { final InternalRegionArguments regionArguments = new InternalRegionArguments(); regionArguments.setIsUsedForMetaRegion(true); final AttributesFactory<String, String> attributesFactory = new AttributesFactory<String, String>();
regionAttrsFactory.setScope(Scope.DISTRIBUTED_ACK); InternalRegionArguments internalArgs = new InternalRegionArguments(); internalArgs.setIsUsedForMetaRegion(true); internalArgs.setMetaRegionWithTransactions(false);
InternalRegionArguments ira = new InternalRegionArguments().setIsUsedForMetaRegion(true) .setCachePerfStatsHolder(statsHolder);
protected <K, V> Region<K, V> createRegion(final String regionName, final RegionAttributes<K, V> attributes) { // Create InternalRegionArguments to set isUsedForMetaRegion true to suppress xml generation // (among other things) InternalRegionArguments ira = new InternalRegionArguments().setDestroyLockFlag(true).setRecreateFlag(false) .setSnapshotInputStream(null).setImageTarget(null).setIsUsedForMetaRegion(true); // Create the region try { return this.cache.createVMRegion(regionName, attributes, ira); } catch (Exception e) { InternalGemFireError ige = new InternalGemFireError( "unexpected exception"); ige.initCause(e); throw ige; } }
public static Region createOrGetExistingExportLogsRegion(boolean isInitiatingMember, InternalCache cache) throws IOException, ClassNotFoundException { InternalCacheForClientAccess cacheForClientAccess = cache.getCacheForProcessingClientRequests(); Region exportLogsRegion = cacheForClientAccess.getInternalRegion(EXPORT_LOGS_REGION); if (exportLogsRegion == null) { AttributesFactory<String, Configuration> regionAttrsFactory = new AttributesFactory<>(); regionAttrsFactory.setDataPolicy(DataPolicy.EMPTY); regionAttrsFactory.setScope(Scope.DISTRIBUTED_ACK); if (isInitiatingMember) { regionAttrsFactory.setCacheWriter(new ExportLogsCacheWriter()); } InternalRegionArguments internalArgs = new InternalRegionArguments(); internalArgs.setIsUsedForMetaRegion(true); exportLogsRegion = cacheForClientAccess.createInternalRegion(EXPORT_LOGS_REGION, regionAttrsFactory.create(), internalArgs); } return exportLogsRegion; }
internalRegionArguments.setIsUsedForMetaRegion(true);
private static String createClientMessagesRegion(RegionAttributes attr, InternalCache cache, int capacity, int port) { // generating unique name in VM for ClientMessagesRegion String regionName = generateNameForClientMsgsRegion(port); try { cache.createVMRegion(regionName, attr, new InternalRegionArguments().setDestroyLockFlag(true).setRecreateFlag(false) .setSnapshotInputStream(null).setImageTarget(null).setIsUsedForMetaRegion(true)); } catch (RegionExistsException ree) { InternalGemFireError assErr = new InternalGemFireError("unexpected exception"); assErr.initCause(ree); throw assErr; } catch (IOException e) { // only if loading snapshot, not here InternalGemFireError assErr = new InternalGemFireError("unexpected exception"); assErr.initCause(e); throw assErr; } catch (ClassNotFoundException e) { // only if loading snapshot, not here InternalGemFireError assErr = new InternalGemFireError("unexpected exception"); assErr.initCause(e); throw assErr; } return regionName; }
/** * This method creates the client health monitoring region. * <p> * GuardedBy ClientHealthMonitoringRegion.class * * @param cache The current GemFire Cache */ private static void initialize(InternalCache 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.setValueConstraint(ClientHealthStats.class); 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.getLogger().error( "Error while creating an admin region", ex); } }
internalArgs.setIsUsedForMetaRegion(true);
af.setDataPolicy(DataPolicy.REPLICATE); InternalRegionArguments ira = new InternalRegionArguments().setInternalRegion(true).setIsUsedForMetaRegion(true); redisMetaData = gemFireCache.createVMRegion(REDIS_META_DATA_REGION, af.create(), ira);
internalArgs.setIsUsedForMetaRegion(true); internalArgs.setMetaRegionWithTransactions(true); try {