geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bogle...@apache.org
Subject incubator-geode git commit: GEODE-11: Added Extension beforeCreate API to make index creation consistent in xml and API
Date Mon, 23 May 2016 20:13:56 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 74b1f1e72 -> 45a4ef29f


GEODE-11: Added Extension beforeCreate API to make index creation consistent in xml and API


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/45a4ef29
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/45a4ef29
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/45a4ef29

Branch: refs/heads/develop
Commit: 45a4ef29f3c8174281aad667265a0764b0b912a3
Parents: 74b1f1e
Author: Barry Oglesby <boglesby@pivotal.io>
Authored: Thu May 19 17:16:03 2016 -0700
Committer: Barry Oglesby <boglesby@pivotal.io>
Committed: Mon May 23 13:07:37 2016 -0700

----------------------------------------------------------------------
 .../internal/cache/extension/Extension.java     | 15 ++++++++-
 .../cache/extension/SimpleExtensionPoint.java   |  7 ++++
 .../internal/cache/xmlcache/CacheCreation.java  |  2 ++
 .../internal/cache/xmlcache/RegionCreation.java |  4 ++-
 .../gemfire/cache30/CacheXml81DUnitTest.java    |  7 ++++
 .../SimpleExtensionPointJUnitTest.java          | 35 ++++++++++++++++++++
 .../extension/mock/AbstractMockExtension.java   |  7 ++++
 .../mock/CreateMockCacheExtensionFunction.java  |  1 +
 .../mock/CreateMockRegionExtensionFunction.java |  5 +--
 .../lucene/internal/LuceneServiceImpl.java      | 24 ++++++++------
 .../internal/xml/LuceneIndexCreation.java       | 20 ++++-------
 .../lucene/internal/xml/LuceneXmlParser.java    |  3 --
 .../ClusterConfigurationDUnitTest.java          |  2 ++
 13 files changed, 101 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/45a4ef29/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/extension/Extension.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/extension/Extension.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/extension/Extension.java
index 3347bd1..bccfc79 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/extension/Extension.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/extension/Extension.java
@@ -17,6 +17,7 @@
 
 package com.gemstone.gemfire.internal.cache.extension;
 
+import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheXml;
 import com.gemstone.gemfire.internal.cache.xmlcache.XmlGenerator;
 
@@ -38,9 +39,21 @@ public interface Extension<T> {
   XmlGenerator<T> getXmlGenerator();
 
   /**
+   * Called by {@link CacheXml} objects that are {@link Extensible} before
+   * creating this extension.
+   *
+   * @param source
+   *          source object this extension is currently attached to.
+   * @param cache
+   *          target object to attach any created extensions to.
+   * @since Geode 1.0.0
+   */
+  void beforeCreate(Extensible<T> source, Cache cache);
+
+  /**
    * Called by {@link CacheXml} objects that are {@link Extensible} to create
    * this extension.
-   * 
+   *
    * @param source
    *          source object this extension is currently attached to.
    * @param target

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/45a4ef29/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/extension/SimpleExtensionPoint.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/extension/SimpleExtensionPoint.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/extension/SimpleExtensionPoint.java
index 4402083..7ae6a63 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/extension/SimpleExtensionPoint.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/extension/SimpleExtensionPoint.java
@@ -19,6 +19,7 @@ package com.gemstone.gemfire.internal.cache.extension;
 
 import java.util.ArrayList;
 
+import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.internal.util.CollectionUtils;
 
 /**
@@ -76,6 +77,12 @@ public class SimpleExtensionPoint<T> implements ExtensionPoint<T>
{
     return target;
   }
 
+  public void beforeCreate(final Cache cache) {
+    for (final Extension<T> extension : extensions) {
+      extension.beforeCreate(extensible, cache);
+    }
+  }
+
   public void fireCreate(final Extensible<T> newTarget) {
     for (final Extension<T> extension : extensions) {
       extension.onCreate(extensible, newTarget);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/45a4ef29/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreation.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreation.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreation.java
index d52d05e..bdde29e 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreation.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreation.java
@@ -380,6 +380,8 @@ public class CacheCreation implements InternalCache {
     throws TimeoutException, CacheWriterException,
            GatewayException,
            RegionExistsException {
+    extensionPoint.beforeCreate(cache);
+
     cache.setDeclarativeCacheConfig(cacheConfig);
     
     if (cache.isClient()) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/45a4ef29/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/RegionCreation.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/RegionCreation.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/RegionCreation.java
index b3706ba..e26ab57 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/RegionCreation.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/RegionCreation.java
@@ -257,7 +257,9 @@ public class RegionCreation implements Region, Extensible<Region<?,?>>
{
     this.attrs.inheritAttributes(cache);
     this.attrs.setIndexes(this.indexes);
     this.attrs.prepareForValidation();
-    
+
+    extensionPoint.beforeCreate(cache);
+
     try {
       root = ((GemFireCacheImpl)cache).basicCreateRegion(this.name, new AttributesFactory(this.attrs).create());
     } catch (RegionExistsException ex) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/45a4ef29/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml81DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml81DUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml81DUnitTest.java
index 143150d..b40af91 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml81DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml81DUnitTest.java
@@ -66,11 +66,13 @@ public class CacheXml81DUnitTest extends CacheXml80DUnitTest {
     final MockCacheExtension extension = new MockCacheExtension("testCacheExtension");
     cache.getExtensionPoint().addExtension(extension);
 
+    assertEquals(0, extension.beforeCreateCounter.get());
     assertEquals(0, extension.onCreateCounter.get());
     assertEquals(0, extension.getXmlGeneratorCounter.get());
 
     testXml(cache);
 
+    assertEquals(0, extension.beforeCreateCounter.get());
     assertEquals(0, extension.onCreateCounter.get());
     assertEquals(1, extension.getXmlGeneratorCounter.get());
 
@@ -80,6 +82,7 @@ public class CacheXml81DUnitTest extends CacheXml80DUnitTest {
     final MockCacheExtension m = (MockCacheExtension) c.getExtensionPoint().getExtensions().iterator().next();
     assertNotNull(m);
 
+    assertEquals(1, m.beforeCreateCounter.get());
     assertEquals(1, m.onCreateCounter.get());
     assertEquals(0, m.getXmlGeneratorCounter.get());
 
@@ -100,11 +103,13 @@ public class CacheXml81DUnitTest extends CacheXml80DUnitTest {
     final MockRegionExtension extension = new MockRegionExtension("test");
     region.getExtensionPoint().addExtension(extension);
 
+    assertEquals(0, extension.beforeCreateCounter.get());
     assertEquals(0, extension.onCreateCounter.get());
     assertEquals(0, extension.getXmlGeneratorCounter.get());
 
     testXml(cache);
 
+    assertEquals(0, extension.beforeCreateCounter.get());
     assertEquals(0, extension.onCreateCounter.get());
     assertEquals(1, extension.getXmlGeneratorCounter.get());
 
@@ -114,6 +119,7 @@ public class CacheXml81DUnitTest extends CacheXml80DUnitTest {
     final MockRegionExtension m = (MockRegionExtension) r.getExtensionPoint().getExtensions().iterator().next();
     assertNotNull(m);
 
+    assertEquals(1, m.beforeCreateCounter.get());
     assertEquals(1, m.onCreateCounter.get());
     assertEquals(0, m.getXmlGeneratorCounter.get());
 
@@ -136,6 +142,7 @@ public class CacheXml81DUnitTest extends CacheXml80DUnitTest {
     final MockRegionExtension extension = new MockRegionExtension("exception");
     region.getExtensionPoint().addExtension(extension);
 
+    assertEquals(0, extension.beforeCreateCounter.get());
     assertEquals(0, extension.onCreateCounter.get());
     assertEquals(0, extension.getXmlGeneratorCounter.get());
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/45a4ef29/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/SimpleExtensionPointJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/SimpleExtensionPointJUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/SimpleExtensionPointJUnitTest.java
index 4fd7837..ad98e0b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/SimpleExtensionPointJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/SimpleExtensionPointJUnitTest.java
@@ -22,6 +22,8 @@ import java.util.Iterator;
 import java.util.NoSuchElementException;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.test.fake.Fakes;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -177,6 +179,34 @@ public class SimpleExtensionPointJUnitTest {
     assertEquals(0, counter.get());
   }
 
+  /**
+   * Test method for {@link SimpleExtensionPoint#beforeCreate(Cache)} .
+   */
+  @Test
+  public void testBeforeCreate() {
+    final MockImpl m = new MockImpl();
+    final Cache c = Fakes.cache();
+    final AtomicInteger counter = new AtomicInteger(0);
+    final MockExtension extension = new MockExtension() {
+      @Override
+      public void beforeCreate(Extensible<MockInterface> source, Cache cache) {
+        counter.incrementAndGet();
+      }
+    };
+
+    counter.set(0);
+    m.getExtensionPoint().addExtension(extension);
+    // Verify beforeCreate is invoked when the extension is added
+    m.extensionPoint.beforeCreate(c);
+    assertEquals(1, counter.get());
+
+    counter.set(0);
+    m.getExtensionPoint().removeExtension(extension);
+    // Verify beforeCreate is not invoked when the extension is removed
+    m.extensionPoint.beforeCreate(c);
+    assertEquals(0, counter.get());
+  }
+
   private interface MockInterface {
     public void method1();
   }
@@ -204,6 +234,11 @@ public class SimpleExtensionPointJUnitTest {
     }
 
     @Override
+    public void beforeCreate(Extensible<MockInterface> source, Cache cache) {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
     public void onCreate(Extensible<MockInterface> source, Extensible<MockInterface>
target) {
       throw new UnsupportedOperationException();
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/45a4ef29/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/mock/AbstractMockExtension.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/mock/AbstractMockExtension.java
b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/mock/AbstractMockExtension.java
index 2be7047..bc0f3f4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/mock/AbstractMockExtension.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/mock/AbstractMockExtension.java
@@ -19,6 +19,7 @@ package com.gemstone.gemfire.internal.cache.extension.mock;
 
 import java.util.concurrent.atomic.AtomicInteger;
 
+import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.internal.cache.extension.Extensible;
 import com.gemstone.gemfire.internal.cache.extension.Extension;
 import com.gemstone.gemfire.internal.cache.xmlcache.XmlGenerator;
@@ -30,6 +31,7 @@ import com.gemstone.gemfire.internal.cache.xmlcache.XmlGenerator;
  * @since 8.1
  */
 public abstract class AbstractMockExtension<T> implements Extension<T> {
+  public AtomicInteger beforeCreateCounter = new AtomicInteger();
   public AtomicInteger onCreateCounter = new AtomicInteger();
   public AtomicInteger getXmlGeneratorCounter = new AtomicInteger();
 
@@ -48,6 +50,11 @@ public abstract class AbstractMockExtension<T> implements Extension<T>
{
   }
 
   @Override
+  public void beforeCreate(Extensible<T> source, Cache cache) {
+    beforeCreateCounter.incrementAndGet();
+  }
+
+  @Override
   public void onCreate(Extensible<T> source, Extensible<T> target) {
     onCreateCounter.incrementAndGet();
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/45a4ef29/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/mock/CreateMockCacheExtensionFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/mock/CreateMockCacheExtensionFunction.java
b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/mock/CreateMockCacheExtensionFunction.java
index 8b2e2ad..767079f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/mock/CreateMockCacheExtensionFunction.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/mock/CreateMockCacheExtensionFunction.java
@@ -58,6 +58,7 @@ public class CreateMockCacheExtensionFunction extends FunctionAdapter {
     @SuppressWarnings("unchecked")
     final Extensible<Cache> extensible = (Extensible<Cache>) cache;
     final MockCacheExtension extension = new MockCacheExtension(value);
+    extension.beforeCreate(extensible, cache);
     extension.onCreate(extensible, extensible);
 
     final XmlEntity xmlEntity = XmlEntity.builder().withType(ELEMENT_CACHE).withNamespace(PREFIX,
NAMESPACE).build();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/45a4ef29/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/mock/CreateMockRegionExtensionFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/mock/CreateMockRegionExtensionFunction.java
b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/mock/CreateMockRegionExtensionFunction.java
index 6d015ed..224f407 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/mock/CreateMockRegionExtensionFunction.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/extension/mock/CreateMockRegionExtensionFunction.java
@@ -40,9 +40,9 @@ import com.gemstone.gemfire.management.internal.configuration.domain.XmlEntity;
  * <dd>
  * <dl>
  * <dt>{@link String} regionName</dt>
- * <dd>Name of region on which to create {@link MockCacheExtension}.</dd>
+ * <dd>Name of region on which to create {@link MockRegionExtension}.</dd>
  * <dt>{@link String} value</dt>
- * <dd>Value to set. See {@link MockCacheExtension#getValue()}.</dd>
+ * <dd>Value to set. See {@link MockRegionExtension#getValue()}.</dd>
  * </dl>
  * </dt>
  * </dl>
@@ -70,6 +70,7 @@ public class CreateMockRegionExtensionFunction extends FunctionAdapter {
     @SuppressWarnings("unchecked")
     final Extensible<Region<?, ?>> extensible = (Extensible<Region<?, ?>>)
region;
     final MockRegionExtension extension = new MockRegionExtension(value);
+    extension.beforeCreate(extensible, cache);
     extension.onCreate(extensible, extensible);
 
     XmlEntity xmlEntity = new XmlEntity(CacheXml.REGION, "name", region.getName());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/45a4ef29/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java
b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java
index 58a9b20..1f011a6 100644
--- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java
+++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneServiceImpl.java
@@ -19,10 +19,7 @@
 
 package com.gemstone.gemfire.cache.lucene.internal;
 
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 
 import org.apache.logging.log4j.Logger;
 import org.apache.lucene.analysis.Analyzer;
@@ -132,15 +129,17 @@ public class LuceneServiceImpl implements InternalLuceneService {
       @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(dataRegionPath)) {
           String aeqId = LuceneServiceImpl.getUniqueIndexName(indexName, dataRegionPath);
-          AttributesFactory af = new AttributesFactory(attrs);
-          af.addAsyncEventQueueId(aeqId);
-          return af.create();
-        } else {
-          return attrs;
+          if (!attrs.getAsyncEventQueueIds().contains(aeqId)) {
+            AttributesFactory af = new AttributesFactory(attrs);
+            af.addAsyncEventQueueId(aeqId);
+            updatedRA = af.create();
+          }
         }
+        return updatedRA;
       }
       
       @Override
@@ -222,11 +221,16 @@ public class LuceneServiceImpl implements InternalLuceneService {
   }
 
   @Override
+  public void beforeCreate(Extensible<Cache> source, Cache cache) {
+    // Nothing to do here.
+  }
+
+  @Override
   public void onCreate(Extensible<Cache> source, Extensible<Cache> target) {
     //This is called when CacheCreation (source) is turned into a GemfireCacheImpl (target)
     //nothing to do there.
   }
-  
+
   public void registerIndex(LuceneIndex index){
     String regionAndIndex = getUniqueIndexName(index.getName(), index.getRegionPath()); 
     if( !indexMap.containsKey( regionAndIndex )) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/45a4ef29/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexCreation.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexCreation.java
b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexCreation.java
index a3bdd24..33cb3d3 100644
--- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexCreation.java
+++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexCreation.java
@@ -82,26 +82,18 @@ public class LuceneIndexCreation implements LuceneIndex, Extension<Region<?,
?>>
   }
 
   @Override
-  public void onCreate(Extensible<Region<?, ?>> source,
-      Extensible<Region<?, ?>> target) {
-    Cache cache = target.getExtensionPoint().getTarget().getCache();
+  public void beforeCreate(Extensible<Region<?, ?>> source, Cache cache) {
     LuceneServiceImpl service = (LuceneServiceImpl) LuceneServiceProvider.get(cache);
-    Region region = target.getExtensionPoint().getTarget();
-    String aeqId = LuceneServiceImpl.getUniqueIndexName(getName(), getRegionPath());
-    //Here, it is safe to add the aeq with the mutator, because onCreate is
-    //fired in a special place before the region is initialized.
-    //TODO - this may only work for PRs. We need to intercept the attributes
-    //before the region is created with a RegionListener.
-    region.getAttributesMutator().addAsyncEventQueueId(aeqId);
-    Analyzer analyzer = null;
     if (this.fieldAnalyzers == null) {
-      analyzer = new StandardAnalyzer();
+      service.createIndex(getName(), getRegionPath(), getFieldNames());
     } else {
-      analyzer = new PerFieldAnalyzerWrapper(new StandardAnalyzer(), this.fieldAnalyzers);
+      service.createIndex(getName(), getRegionPath(), this.fieldAnalyzers);
     }
-    service.afterDataRegionCreated(getName(), analyzer, getRegionPath(), this.fieldAnalyzers,
getFieldNames());
   }
 
+  @Override
+  public void onCreate(Extensible<Region<?, ?>> source, Extensible<Region<?,
?>> target) {}
+
   protected void addField(String name) {
     this.fieldNames.add(name);
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/45a4ef29/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneXmlParser.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneXmlParser.java
b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneXmlParser.java
index 40bf0ac..5bdbe04 100644
--- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneXmlParser.java
+++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneXmlParser.java
@@ -73,10 +73,7 @@ public class LuceneXmlParser extends AbstractXmlParser {
 
   private void startIndex(Attributes atts) {
     final RegionCreation region = (RegionCreation) stack.peek();
-    RegionAttributesCreation rac = (RegionAttributesCreation) region.getAttributes();
     String name = atts.getValue(NAME);
-    rac.addAsyncEventQueueId(LuceneServiceImpl.getUniqueIndexName(name, region.getFullPath()));
-    
     LuceneIndexCreation indexCreation = new LuceneIndexCreation();
     indexCreation.setName(name);
     indexCreation.setRegion(region);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/45a4ef29/geode-wan/src/test/java/com/gemstone/gemfire/management/internal/configuration/ClusterConfigurationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/management/internal/configuration/ClusterConfigurationDUnitTest.java
b/geode-wan/src/test/java/com/gemstone/gemfire/management/internal/configuration/ClusterConfigurationDUnitTest.java
index d8692ce..d16d168 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/management/internal/configuration/ClusterConfigurationDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/management/internal/configuration/ClusterConfigurationDUnitTest.java
@@ -312,6 +312,7 @@ public class ClusterConfigurationDUnitTest extends CliCommandTestBase
{
         // should only be one region extension
         final MockRegionExtension mockRegionExtension = (MockRegionExtension) ((Extensible<Region<?,?>>)
region1).getExtensionPoint().getExtensions().iterator().next();
         assertNotNull(mockRegionExtension);
+        assertEquals(1, mockRegionExtension.beforeCreateCounter.get());
         assertEquals(1, mockRegionExtension.onCreateCounter.get());
         assertEquals("value2", mockRegionExtension.getValue());
 
@@ -320,6 +321,7 @@ public class ClusterConfigurationDUnitTest extends CliCommandTestBase
{
         // should only be one cache extension
         final MockCacheExtension mockCacheExtension = (MockCacheExtension) ((Extensible<Cache>)
cache).getExtensionPoint().getExtensions().iterator().next();
         assertNotNull(mockCacheExtension);
+        assertEquals(1, mockCacheExtension.beforeCreateCounter.get());
         assertEquals(1, mockCacheExtension.onCreateCounter.get());
         assertEquals("value2", mockCacheExtension.getValue());
 


Mime
View raw message