/** * Adds a asyncEventQueueId to the RegionAttributes * * @param asyncEventQueueId id of AsyncEventQueue * @return a reference to this RegionFactory instance * @since GemFire 7.0 */ public RegionFactory<K, V> addAsyncEventQueueId(String asyncEventQueueId) { this.attrsFactory.addAsyncEventQueueId(asyncEventQueueId); return this; }
private static void addAsyncEventQueueIds(AttributesFactory fact, String asyncQueueIds) { if (asyncQueueIds != null) { StringTokenizer tokenizer = new StringTokenizer(asyncQueueIds, ","); while (tokenizer.hasMoreTokens()) { String asyncQueueId = tokenizer.nextToken(); fact.addAsyncEventQueueId(asyncQueueId); } } }
@Override public RegionAttributes beforeCreate(Region parent, String regionName, RegionAttributes attrs, InternalRegionArguments internalRegionArgs) { RegionAttributes updatedRA = attrs; String path = parent == null ? "/" + regionName : parent.getFullPath() + "/" + regionName; if (path.equals(this.regionPath) && this.beforeCreateInvoked.compareAndSet(false, true)) { LuceneServiceImpl.validateRegionAttributes(attrs); String aeqId = LuceneServiceImpl.getUniqueIndexName(this.indexName, this.regionPath); if (!attrs.getAsyncEventQueueIds().contains(aeqId)) { AttributesFactory af = new AttributesFactory(attrs); af.addAsyncEventQueueId(aeqId); updatedRA = af.create(); } // Add index creation profile internalRegionArgs.addCacheServiceProfile(new LuceneIndexCreationProfile(this.indexName, this.regionPath, this.fields, this.analyzer, this.fieldAnalyzers, serializer)); luceneIndex = this.service.beforeDataRegionCreated(this.indexName, this.regionPath, attrs, this.analyzer, this.fieldAnalyzers, aeqId, serializer, this.fields); // Add internal async event id internalRegionArgs.addInternalAsyncEventQueueId(aeqId); } return updatedRA; }