You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by nn...@apache.org on 2018/04/23 03:47:40 UTC

[geode] branch develop updated: GEODE-5102: Lucene rolling test with REINDEX (#1818)

This is an automated email from the ASF dual-hosted git repository.

nnag pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 47ae5e7  GEODE-5102: Lucene rolling test with REINDEX (#1818)
47ae5e7 is described below

commit 47ae5e7d82271d55aa20331407d8ce3d5807b905
Author: Nabarun Nag <na...@users.noreply.github.com>
AuthorDate: Sun Apr 22 20:47:35 2018 -0700

    GEODE-5102: Lucene rolling test with REINDEX (#1818)
    
            * Lucene Rolling upgrade tests are now executed with the reindex flag enabled
---
 .../LuceneSearchWithRollingUpgradeDUnit.java       |  6 ++++
 ...hRollingUpgradeReindexFlagEnabledDUnitTest.java | 40 ++++++++++++++++++++++
 2 files changed, 46 insertions(+)

diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneSearchWithRollingUpgradeDUnit.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneSearchWithRollingUpgradeDUnit.java
index ee98f24..dc999eb 100644
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneSearchWithRollingUpgradeDUnit.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneSearchWithRollingUpgradeDUnit.java
@@ -791,6 +791,12 @@ public class LuceneSearchWithRollingUpgradeDUnit extends JUnit4DistributedTestCa
   private VM rollServerToCurrentCreateLuceneIndexAndCreateRegion(VM oldServer, String regionType,
       File diskdir, String shortcutName, String regionName, int[] locatorPorts) throws Exception {
     VM rollServer = rollServerToCurrent(oldServer, locatorPorts);
+    return createLuceneIndexAndRegionOnRolledServer(regionType, diskdir, shortcutName, regionName,
+        rollServer);
+  }
+
+  protected VM createLuceneIndexAndRegionOnRolledServer(String regionType, File diskdir,
+      String shortcutName, String regionName, VM rollServer) throws Exception {
     rollServer.invoke(() -> createLuceneIndex(cache, regionName, INDEX_NAME));
     // recreate region on "rolled" server
     if ((regionType.equals("persistentPartitioned"))) {
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneSearchWithRollingUpgradeReindexFlagEnabledDUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneSearchWithRollingUpgradeReindexFlagEnabledDUnitTest.java
new file mode 100644
index 0000000..cca2124
--- /dev/null
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneSearchWithRollingUpgradeReindexFlagEnabledDUnitTest.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.cache.lucene;
+
+import java.io.File;
+
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.cache.lucene.internal.LuceneServiceImpl;
+import org.apache.geode.test.dunit.VM;
+import org.apache.geode.test.junit.categories.BackwardCompatibilityTest;
+import org.apache.geode.test.junit.categories.DistributedTest;
+
+@Category({DistributedTest.class, BackwardCompatibilityTest.class})
+public class LuceneSearchWithRollingUpgradeReindexFlagEnabledDUnitTest
+    extends LuceneSearchWithRollingUpgradeDUnit {
+  public LuceneSearchWithRollingUpgradeReindexFlagEnabledDUnitTest(String version) {
+    super(version);
+  }
+
+  @Override
+  protected VM createLuceneIndexAndRegionOnRolledServer(String regionType, File diskdir,
+      String shortcutName, String regionName, VM rollServer) throws Exception {
+    rollServer.invoke(() -> LuceneServiceImpl.LUCENE_REINDEX = true);
+    return super.createLuceneIndexAndRegionOnRolledServer(regionType, diskdir, shortcutName,
+        regionName, rollServer);
+  }
+}

-- 
To stop receiving notification emails like this one, please contact
nnag@apache.org.