ASTERIXDB-1077: Fixed - Inverted index tests are slow compared to others

- Reduced the number of searches during the inverted index searches
- Reduced the number of Jaccard search modifiers

Change-Id: I1d8fc1d30055798fee7f3f23d08a57af867e3a3c
Reviewed-on: https://asterix-gerrit.ics.uci.edu/442
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Young-Seok Kim <kisskys@gmail.com>
Reviewed-by: Ian Maxon <imaxon@apache.org>
diff --git a/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/storage/am/config/AccessMethodTestsConfig.java b/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/storage/am/config/AccessMethodTestsConfig.java
index bcb3482..60e10ad 100644
--- a/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/storage/am/config/AccessMethodTestsConfig.java
+++ b/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/storage/am/config/AccessMethodTestsConfig.java
@@ -89,15 +89,15 @@
     // Test parameters.
     public static final int LSM_INVINDEX_NUM_DOCS_TO_INSERT = 100;
     // Used for full-fledged search test.
-    public static final int LSM_INVINDEX_NUM_DOC_QUERIES = 1000;
-    public static final int LSM_INVINDEX_NUM_RANDOM_QUERIES = 1000;
+    public static final int LSM_INVINDEX_NUM_DOC_QUERIES = 50;
+    public static final int LSM_INVINDEX_NUM_RANDOM_QUERIES = 50;
     // Used for non-search tests to sanity check index searches.
-    public static final int LSM_INVINDEX_TINY_NUM_DOC_QUERIES = 200;
-    public static final int LSM_INVINDEX_TINY_NUM_RANDOM_QUERIES = 200;
+    public static final int LSM_INVINDEX_TINY_NUM_DOC_QUERIES = 10;
+    public static final int LSM_INVINDEX_TINY_NUM_RANDOM_QUERIES = 10;
     public static final int LSM_INVINDEX_NUM_BULKLOAD_ROUNDS = 5;
     public static final int LSM_INVINDEX_MAX_TREES_TO_MERGE = 5;
-    public static final int LSM_INVINDEX_NUM_INSERT_ROUNDS = 3;
-    public static final int LSM_INVINDEX_NUM_DELETE_ROUNDS = 3;
+    public static final int LSM_INVINDEX_NUM_INSERT_ROUNDS = 2;
+    public static final int LSM_INVINDEX_NUM_DELETE_ROUNDS = 2;
     // Allocate a generous size to make sure we have enough elements for all tests.
     public static final int LSM_INVINDEX_SCAN_COUNT_ARRAY_SIZE = 1000000;
     public static final int LSM_INVINDEX_MULTITHREAD_NUM_OPERATIONS = 200;
@@ -123,7 +123,7 @@
 // Test params for LSMRTree and LSMRTreeWithAntiMatterTuples.
 public static final int LSM_RTREE_BULKLOAD_ROUNDS = 5;
 public static final boolean LSM_RTREE_TEST_RSTAR_POLICY = false;
-public static final int LSM_RTREE_MAX_TREES_TO_MERGE = 3;	
+public static final int LSM_RTREE_MAX_TREES_TO_MERGE = 3;
 public static final int LSM_RTREE_NUM_MUTABLE_COMPONENTS = 2;
 
 // Test params for BTree, LSMBTree.
@@ -136,14 +136,14 @@
 public static final int LSM_BTREE_BULKLOAD_ROUNDS = 5;
 public static final int LSM_BTREE_MAX_TREES_TO_MERGE = 10;
 public static final int LSM_BTREE_NUM_MUTABLE_COMPONENTS = 2;
-	
-	
+
+
 // Mem configuration for RTree.
 public static final int RTREE_PAGE_SIZE = 512;
 public static final int RTREE_NUM_PAGES = 1000;
 public static final int RTREE_MAX_OPEN_FILES = Integer.MAX_VALUE;
 public static final int RTREE_HYRACKS_FRAME_SIZE = 128;
-	
+
 // Mem configuration for LSMRTree and LSMRTreeWithAntiMatterTuples.
 public static final int LSM_RTREE_DISK_PAGE_SIZE = 512;
 public static final int LSM_RTREE_DISK_NUM_PAGES = 10000;
@@ -152,13 +152,13 @@
 public static final int LSM_RTREE_MEM_NUM_PAGES = 1000;
 public static final int LSM_RTREE_HYRACKS_FRAME_SIZE = 128;
 public static final double LSM_RTREE_BLOOMFILTER_FALSE_POSITIVE_RATE = 0.01;
-	
+
 // Mem configuration for BTree.
 public static final int BTREE_PAGE_SIZE = 256;
 public static final int BTREE_NUM_PAGES = 100;
 public static final int BTREE_MAX_OPEN_FILES = Integer.MAX_VALUE;
 public static final int BTREE_HYRACKS_FRAME_SIZE = 128;
-	
+
 // Mem configuration for LSMBTree.
 public static final int LSM_BTREE_DISK_PAGE_SIZE = 256;
 public static final int LSM_BTREE_DISK_NUM_PAGES = 10000;
diff --git a/hyracks/hyracks-tests/hyracks-storage-am-lsm-invertedindex-test/src/test/java/org/apache/hyracks/storage/am/lsm/invertedindex/common/AbstractInvertedIndexSearchTest.java b/hyracks/hyracks-tests/hyracks-storage-am-lsm-invertedindex-test/src/test/java/org/apache/hyracks/storage/am/lsm/invertedindex/common/AbstractInvertedIndexSearchTest.java
index 6b14951..2c239c5 100644
--- a/hyracks/hyracks-tests/hyracks-storage-am-lsm-invertedindex-test/src/test/java/org/apache/hyracks/storage/am/lsm/invertedindex/common/AbstractInvertedIndexSearchTest.java
+++ b/hyracks/hyracks-tests/hyracks-storage-am-lsm-invertedindex-test/src/test/java/org/apache/hyracks/storage/am/lsm/invertedindex/common/AbstractInvertedIndexSearchTest.java
@@ -25,8 +25,6 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import org.junit.Test;
-
 import org.apache.hyracks.storage.am.common.api.IIndex;
 import org.apache.hyracks.storage.am.common.api.IndexException;
 import org.apache.hyracks.storage.am.common.datagen.TupleGenerator;
@@ -38,6 +36,7 @@
 import org.apache.hyracks.storage.am.lsm.invertedindex.util.LSMInvertedIndexTestContext;
 import org.apache.hyracks.storage.am.lsm.invertedindex.util.LSMInvertedIndexTestContext.InvertedIndexType;
 import org.apache.hyracks.storage.am.lsm.invertedindex.util.LSMInvertedIndexTestUtils;
+import org.junit.Test;
 
 public abstract class AbstractInvertedIndexSearchTest extends AbstractInvertedIndexTest {
 
@@ -82,8 +81,7 @@
         List<IInvertedIndexSearchModifier> searchModifiers = new ArrayList<IInvertedIndexSearchModifier>();
         searchModifiers.add(new ConjunctiveSearchModifier());
         searchModifiers.add(new JaccardSearchModifier(1.0f));
-        searchModifiers.add(new JaccardSearchModifier(0.9f));
-        searchModifiers.add(new JaccardSearchModifier(0.7f));
+        searchModifiers.add(new JaccardSearchModifier(0.8f));
         searchModifiers.add(new JaccardSearchModifier(0.5f));
         runTest(testCtx, tupleGen, searchModifiers);
     }
@@ -93,8 +91,7 @@
         List<IInvertedIndexSearchModifier> searchModifiers = new ArrayList<IInvertedIndexSearchModifier>();
         searchModifiers.add(new ConjunctiveSearchModifier());
         searchModifiers.add(new JaccardSearchModifier(1.0f));
-        searchModifiers.add(new JaccardSearchModifier(0.9f));
-        searchModifiers.add(new JaccardSearchModifier(0.7f));
+        searchModifiers.add(new JaccardSearchModifier(0.8f));
         searchModifiers.add(new JaccardSearchModifier(0.5f));
         searchModifiers.add(new EditDistanceSearchModifier(LSMInvertedIndexTestUtils.TEST_GRAM_LENGTH, 0));
         searchModifiers.add(new EditDistanceSearchModifier(LSMInvertedIndexTestUtils.TEST_GRAM_LENGTH, 1));
@@ -105,7 +102,8 @@
 
     @Test
     public void wordTokensInvIndexTest() throws IOException, IndexException {
-        LSMInvertedIndexTestContext testCtx = LSMInvertedIndexTestUtils.createWordInvIndexTestContext(harness, invIndexType);
+        LSMInvertedIndexTestContext testCtx = LSMInvertedIndexTestUtils.createWordInvIndexTestContext(harness,
+                invIndexType);
         testWordInvIndexIndex(testCtx);
     }
 
@@ -118,7 +116,8 @@
 
     @Test
     public void ngramTokensInvIndexTest() throws IOException, IndexException {
-        LSMInvertedIndexTestContext testCtx = LSMInvertedIndexTestUtils.createNGramInvIndexTestContext(harness, invIndexType);
+        LSMInvertedIndexTestContext testCtx = LSMInvertedIndexTestUtils.createNGramInvIndexTestContext(harness,
+                invIndexType);
         testNGramInvIndexIndex(testCtx);
     }