geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasonhu...@apache.org
Subject geode git commit: GEODE-2216: Indexes no longer get removed but instead do not set populated flag
Date Fri, 30 Dec 2016 17:19:40 GMT
Repository: geode
Updated Branches:
  refs/heads/develop 3761f37ce -> 19047faf8


GEODE-2216: Indexes no longer get removed but instead do not set populated flag


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

Branch: refs/heads/develop
Commit: 19047faf864f1f57dadb6eb53ebe767991a33295
Parents: 3761f37
Author: Jason Huynh <huynhja@gmail.com>
Authored: Wed Dec 28 09:15:45 2016 -0800
Committer: Jason Huynh <huynhja@gmail.com>
Committed: Fri Dec 30 09:07:43 2016 -0800

----------------------------------------------------------------------
 .../apache/geode/internal/cache/PartitionedRegion.java    | 10 +---------
 .../internal/cache/PartitionedRegionQueryDUnitTest.java   | 10 ++++++++--
 2 files changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/19047faf/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
index 6a67b59..44f8427 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
@@ -8762,15 +8762,7 @@ public class PartitionedRegion extends LocalRegion
 
     // If exception is throw in any of the above steps
     if (throwException) {
-      try {
-        for (String indexName : exceptionsMap.keySet()) {
-          Index index = indexManager.getIndex(indexName);
-          indexManager.removeIndex(index);
-          removeIndex(index, remotelyOriginated);
-        }
-      } finally {
-        throw new MultiIndexCreationException(exceptionsMap);
-      }
+      throw new MultiIndexCreationException(exceptionsMap);
     }
 
     // set the populate flag for all the created PR indexes

http://git-wip-us.apache.org/repos/asf/geode/blob/19047faf/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryDUnitTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryDUnitTest.java
index eb918bc..e37b5ea 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryDUnitTest.java
@@ -16,6 +16,7 @@ package org.apache.geode.internal.cache;
 
 import org.apache.geode.DataSerializable;
 import org.apache.geode.cache.query.Struct;
+import org.apache.geode.cache.query.internal.index.AbstractIndex;
 import org.apache.geode.pdx.PdxReader;
 import org.apache.geode.pdx.PdxSerializable;
 import org.apache.geode.pdx.PdxWriter;
@@ -282,8 +283,13 @@ public class PartitionedRegionQueryDUnitTest extends JUnit4CacheTestCase
{
     vm1.invoke(() -> {
       Cache cache = getCache();
       Region region = cache.getRegion("region");
-      final Index index = cache.getQueryService().getIndex(region, "ContractDocumentIndex");
-      assertEquals(null, index);
+      final AbstractIndex index =
+          (AbstractIndex) cache.getQueryService().getIndex(region, "ContractDocumentIndex");
+      // either the index was not created locally or it was created but is populated flag
should not
+      // be set.
+      if (index != null) {
+        assertFalse(index.isPopulated());
+      }
     });
   }
 


Mime
View raw message