abdullah alamoudi has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1852

Change subject: [ASTERIXDB-1944][STO] Align LSM inverted index with other 
indexes
......................................................................

[ASTERIXDB-1944][STO] Align LSM inverted index with other indexes

- user model changes: no
- storage format changes: no
- interface changes: yes
  IInvertedIndexComponent was introduced to separate LSM inverted
  index from its component and avoid multiple MethodNotSupported
  exceptions

Change-Id: I0fb7b446edfb14de25ecaf99965ae0a7325101c9
---
M 
hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/api/IInvertedIndex.java
A 
hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/api/IInvertedIndexComponent.java
M 
hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/impls/LSMInvertedIndex.java
M 
hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/impls/LSMInvertedIndexDiskComponent.java
M 
hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/inmemory/InMemoryInvertedIndex.java
M 
hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndex.java
M 
hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndexFactory.java
M 
hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndexRangeSearchCursor.java
M 
hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/PartitionedOnDiskInvertedIndexFactory.java
M 
hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/AbstractTOccurrenceSearcher.java
M 
hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/InvertedListCursorFactory.java
M 
hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/PartitionedTOccurrenceSearcher.java
M 
hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/TOccurrenceSearcher.java
13 files changed, 83 insertions(+), 60 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/52/1852/1

diff --git 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/api/IInvertedIndex.java
 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/api/IInvertedIndex.java
index eceb7b4..a693a99 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/api/IInvertedIndex.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/api/IInvertedIndex.java
@@ -21,16 +21,9 @@
 
 import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
 import org.apache.hyracks.api.dataflow.value.ITypeTraits;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-import org.apache.hyracks.dataflow.common.data.accessors.ITupleReference;
-import org.apache.hyracks.storage.am.common.api.IIndexOperationContext;
 import org.apache.hyracks.storage.common.IIndex;
 
 public interface IInvertedIndex extends IIndex {
-    IInvertedListCursor createInvertedListCursor();
-
-    void openInvertedListCursor(IInvertedListCursor listCursor, 
ITupleReference searchKey, IIndexOperationContext ictx)
-            throws HyracksDataException;
 
     ITypeTraits[] getInvListTypeTraits();
 
@@ -39,13 +32,4 @@
     ITypeTraits[] getTokenTypeTraits();
 
     IBinaryComparatorFactory[] getTokenCmpFactories();
-
-    /**
-     * Purge the index files out of the buffer cache.
-     * Can only be called if the caller is absolutely sure the files don't 
contain dirty pages
-     *
-     * @throws HyracksDataException
-     *             if the index is active
-     */
-    void purge() throws HyracksDataException;
 }
diff --git 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/api/IInvertedIndexComponent.java
 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/api/IInvertedIndexComponent.java
new file mode 100644
index 0000000..8424b06
--- /dev/null
+++ 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/api/IInvertedIndexComponent.java
@@ -0,0 +1,53 @@
+/*
+ * 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.hyracks.storage.am.lsm.invertedindex.api;
+
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.dataflow.common.data.accessors.ITupleReference;
+import org.apache.hyracks.storage.am.common.api.IIndexOperationContext;
+
+public interface IInvertedIndexComponent extends IInvertedIndex {
+    /**
+     * Create an inverted list cursor
+     */
+    IInvertedListCursor createInvertedListCursor();
+
+    /**
+     * Open an inverted list cursor
+     *
+     * @param listCursor
+     *            the cursor to open
+     * @param searchKey
+     *            the search key to use for the operation
+     * @param ictx
+     *            the operation context under which the cursor is to be open
+     * @throws HyracksDataException
+     */
+    void openInvertedListCursor(IInvertedListCursor listCursor, 
ITupleReference searchKey, IIndexOperationContext ictx)
+            throws HyracksDataException;
+
+    /**
+     * Purge the index files out of the buffer cache.
+     * Can only be called if the caller is absolutely sure the files don't 
contain dirty pages
+     *
+     * @throws HyracksDataException
+     *             if the index is active
+     */
+    void purge() throws HyracksDataException;
+}
diff --git 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/impls/LSMInvertedIndex.java
 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/impls/LSMInvertedIndex.java
index 0f862ac..023fb19 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/impls/LSMInvertedIndex.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/impls/LSMInvertedIndex.java
@@ -70,7 +70,6 @@
 import 
org.apache.hyracks.storage.am.lsm.common.impls.LSMComponentFilterManager;
 import org.apache.hyracks.storage.am.lsm.common.impls.LSMIndexSearchCursor;
 import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndex;
-import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedListCursor;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.inmemory.InMemoryInvertedIndex;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.inmemory.InMemoryInvertedIndexAccessor;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.ondisk.OnDiskInvertedIndex;
@@ -595,17 +594,6 @@
     }
 
     @Override
-    public IInvertedListCursor createInvertedListCursor() {
-        throw new UnsupportedOperationException("Cannot create inverted list 
cursor on lsm inverted index.");
-    }
-
-    @Override
-    public void openInvertedListCursor(IInvertedListCursor listCursor, 
ITupleReference searchKey,
-            IIndexOperationContext ictx) throws HyracksDataException {
-        throw new UnsupportedOperationException("Cannot open inverted list 
cursor on lsm inverted index.");
-    }
-
-    @Override
     public ITypeTraits[] getInvListTypeTraits() {
         return invListTypeTraits;
     }
@@ -736,10 +724,5 @@
         return new LSMInvertedIndexMergeOperation(accessor, mergingComponents, 
cursor,
                 mergeFileRefs.getInsertIndexFileReference(), 
mergeFileRefs.getDeleteIndexFileReference(),
                 mergeFileRefs.getBloomFilterFileReference(), callback, 
fileManager.getBaseDir().getAbsolutePath());
-    }
-
-    @Override
-    public void purge() throws HyracksDataException {
-        throw new UnsupportedOperationException();
     }
 }
diff --git 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/impls/LSMInvertedIndexDiskComponent.java
 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/impls/LSMInvertedIndexDiskComponent.java
index 8a12dea..c777547 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/impls/LSMInvertedIndexDiskComponent.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/impls/LSMInvertedIndexDiskComponent.java
@@ -24,17 +24,17 @@
 import org.apache.hyracks.storage.am.common.api.IMetadataPageManager;
 import org.apache.hyracks.storage.am.lsm.common.api.ILSMComponentFilter;
 import org.apache.hyracks.storage.am.lsm.common.impls.AbstractLSMDiskComponent;
-import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndex;
+import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexComponent;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.ondisk.OnDiskInvertedIndex;
 
 public class LSMInvertedIndexDiskComponent extends AbstractLSMDiskComponent {
 
-    private final IInvertedIndex invIndex;
+    private final IInvertedIndexComponent invIndex;
     private final BTree deletedKeysBTree;
     private final BloomFilter bloomFilter;
 
-    public LSMInvertedIndexDiskComponent(IInvertedIndex invIndex, BTree 
deletedKeysBTree, BloomFilter bloomFilter,
-            ILSMComponentFilter filter) throws HyracksDataException {
+    public LSMInvertedIndexDiskComponent(IInvertedIndexComponent invIndex, 
BTree deletedKeysBTree,
+            BloomFilter bloomFilter, ILSMComponentFilter filter) throws 
HyracksDataException {
         super((IMetadataPageManager) deletedKeysBTree.getPageManager(), 
filter);
         this.invIndex = invIndex;
         this.deletedKeysBTree = deletedKeysBTree;
@@ -51,7 +51,7 @@
         bloomFilter.destroy();
     }
 
-    public IInvertedIndex getInvIndex() {
+    public IInvertedIndexComponent getInvIndex() {
         return invIndex;
     }
 
diff --git 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/inmemory/InMemoryInvertedIndex.java
 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/inmemory/InMemoryInvertedIndex.java
index d686634..f6b8b6b 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/inmemory/InMemoryInvertedIndex.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/inmemory/InMemoryInvertedIndex.java
@@ -31,7 +31,7 @@
 import org.apache.hyracks.storage.am.common.api.IIndexOperationContext;
 import org.apache.hyracks.storage.am.common.api.IPageManager;
 import org.apache.hyracks.storage.am.common.ophelpers.IndexOperation;
-import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndex;
+import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexComponent;
 import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedListCursor;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.tokenizers.IBinaryTokenizerFactory;
 import org.apache.hyracks.storage.common.IIndexAccessor;
@@ -40,7 +40,7 @@
 import org.apache.hyracks.storage.common.ISearchOperationCallback;
 import org.apache.hyracks.storage.common.buffercache.IBufferCache;
 
-public class InMemoryInvertedIndex implements IInvertedIndex {
+public class InMemoryInvertedIndex implements IInvertedIndexComponent {
 
     protected final BTree btree;
     protected final ITypeTraits[] tokenTypeTraits;
diff --git 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndex.java
 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndex.java
index 25e4201..b61ed25 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndex.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndex.java
@@ -43,8 +43,8 @@
 import org.apache.hyracks.storage.am.common.api.IPageManagerFactory;
 import org.apache.hyracks.storage.am.common.impls.NoOpOperationCallback;
 import org.apache.hyracks.storage.am.common.tuples.PermutingTupleReference;
-import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndex;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexAccessor;
+import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexComponent;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexSearcher;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedListBuilder;
 import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedListCursor;
@@ -69,7 +69,7 @@
  * implemented features: updates (insert/update/delete) Limitations: a query
  * cannot exceed the size of a Hyracks frame.
  */
-public class OnDiskInvertedIndex implements IInvertedIndex {
+public class OnDiskInvertedIndex implements IInvertedIndexComponent {
     protected final IHyracksCommonContext ctx = new 
DefaultHyracksCommonContext();
 
     // Schema of BTree tuples, set in constructor.
diff --git 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndexFactory.java
 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndexFactory.java
index 70fcd03..5083960 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndexFactory.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndexFactory.java
@@ -26,6 +26,7 @@
 import org.apache.hyracks.storage.am.common.api.IPageManagerFactory;
 import org.apache.hyracks.storage.am.lsm.common.impls.IndexFactory;
 import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndex;
+import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexComponent;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexFileNameMapper;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedListBuilder;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedListBuilderFactory;
@@ -55,7 +56,7 @@
     }
 
     @Override
-    public IInvertedIndex createIndexInstance(FileReference dictBTreeFile) 
throws HyracksDataException {
+    public IInvertedIndexComponent createIndexInstance(FileReference 
dictBTreeFile) throws HyracksDataException {
         String invListsFilePath = 
fileNameMapper.getInvListsFilePath(dictBTreeFile.getFile().getAbsolutePath());
         FileReference invListsFile = 
ioManager.resolveAbsolutePath(invListsFilePath);
         IInvertedListBuilder invListBuilder = invListBuilderFactory.create();
diff --git 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndexRangeSearchCursor.java
 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndexRangeSearchCursor.java
index 41cc7eb..29f4993 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndexRangeSearchCursor.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndexRangeSearchCursor.java
@@ -26,7 +26,7 @@
 import org.apache.hyracks.storage.am.common.impls.NoOpOperationCallback;
 import org.apache.hyracks.storage.am.common.tuples.ConcatenatingTupleReference;
 import org.apache.hyracks.storage.am.common.tuples.PermutingTupleReference;
-import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndex;
+import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexComponent;
 import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedListCursor;
 import org.apache.hyracks.storage.common.ICursorInitialState;
 import org.apache.hyracks.storage.common.IIndexAccessor;
@@ -40,7 +40,7 @@
 
     private final BTree btree;
     private final IIndexAccessor btreeAccessor;
-    private final IInvertedIndex invIndex;
+    private final IInvertedIndexComponent invIndex;
     private final IIndexOperationContext opCtx;
     private final IInvertedListCursor invListCursor;
     private boolean unpinNeeded;
@@ -51,7 +51,7 @@
     private final PermutingTupleReference tokenTuple;
     private ConcatenatingTupleReference concatTuple;
 
-    public OnDiskInvertedIndexRangeSearchCursor(IInvertedIndex invIndex, 
IIndexOperationContext opCtx) {
+    public OnDiskInvertedIndexRangeSearchCursor(IInvertedIndexComponent 
invIndex, IIndexOperationContext opCtx) {
         this.btree = ((OnDiskInvertedIndex) invIndex).getBTree();
         this.btreeAccessor = 
btree.createAccessor(NoOpOperationCallback.INSTANCE, 
NoOpOperationCallback.INSTANCE);
         this.invIndex = invIndex;
diff --git 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/PartitionedOnDiskInvertedIndexFactory.java
 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/PartitionedOnDiskInvertedIndexFactory.java
index 5b2888a..c3c7a5a 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/PartitionedOnDiskInvertedIndexFactory.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/PartitionedOnDiskInvertedIndexFactory.java
@@ -24,7 +24,7 @@
 import org.apache.hyracks.api.io.FileReference;
 import org.apache.hyracks.api.io.IIOManager;
 import org.apache.hyracks.storage.am.common.api.IPageManagerFactory;
-import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndex;
+import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexComponent;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexFileNameMapper;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedListBuilder;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedListBuilderFactory;
@@ -42,7 +42,7 @@
     }
 
     @Override
-    public IInvertedIndex createIndexInstance(FileReference dictBTreeFile) 
throws HyracksDataException {
+    public IInvertedIndexComponent createIndexInstance(FileReference 
dictBTreeFile) throws HyracksDataException {
         String invListsFilePath = 
fileNameMapper.getInvListsFilePath(dictBTreeFile.getFile().getAbsolutePath());
         FileReference invListsFile = 
ioManager.resolveAbsolutePath(invListsFilePath);
         IInvertedListBuilder invListBuilder = invListBuilderFactory.create();
diff --git 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/AbstractTOccurrenceSearcher.java
 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/AbstractTOccurrenceSearcher.java
index 5faf595..c32888a 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/AbstractTOccurrenceSearcher.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/AbstractTOccurrenceSearcher.java
@@ -37,7 +37,7 @@
 import org.apache.hyracks.dataflow.common.data.accessors.FrameTupleReference;
 import org.apache.hyracks.dataflow.common.data.accessors.ITupleReference;
 import 
org.apache.hyracks.dataflow.common.data.marshalling.UTF8StringSerializerDeserializer;
-import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndex;
+import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexComponent;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexSearcher;
 import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedListCursor;
 import org.apache.hyracks.storage.am.lsm.invertedindex.api.IObjectFactory;
@@ -61,7 +61,7 @@
 
     protected final InvertedListMerger invListMerger;
     protected final SearchResult searchResult;
-    protected final IInvertedIndex invIndex;
+    protected final IInvertedIndexComponent invIndex;
     protected final MultiComparator invListCmp;
 
     protected final ArrayTupleBuilder queryTokenBuilder = new 
ArrayTupleBuilder(QUERY_TOKEN_REC_DESC.getFieldCount());
@@ -74,15 +74,16 @@
     protected final IObjectFactory<IInvertedListCursor> invListCursorFactory;
     protected final ObjectCache<IInvertedListCursor> invListCursorCache;
 
-    public AbstractTOccurrenceSearcher(IHyracksCommonContext ctx, 
IInvertedIndex invIndex) throws HyracksDataException {
+    public AbstractTOccurrenceSearcher(IHyracksCommonContext ctx, 
IInvertedIndexComponent invIndex)
+            throws HyracksDataException {
         this.ctx = ctx;
         this.invListMerger = new InvertedListMerger(ctx, invIndex);
         this.searchResult = new SearchResult(invIndex.getInvListTypeTraits(), 
ctx);
         this.invIndex = invIndex;
         this.invListCmp = 
MultiComparator.create(invIndex.getInvListCmpFactories());
         this.invListCursorFactory = new InvertedListCursorFactory(invIndex);
-        this.invListCursorCache = new ObjectCache<>(invListCursorFactory, 
OBJECT_CACHE_INIT_SIZE,
-                OBJECT_CACHE_EXPAND_SIZE);
+        this.invListCursorCache =
+                new ObjectCache<>(invListCursorFactory, 
OBJECT_CACHE_INIT_SIZE, OBJECT_CACHE_EXPAND_SIZE);
         this.queryTokenFrame = new VSizeFrame(ctx);
         this.queryTokenAppender = new 
FrameTupleAppenderAccessor(QUERY_TOKEN_REC_DESC);
         this.queryTokenAppender.reset(queryTokenFrame, true);
diff --git 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/InvertedListCursorFactory.java
 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/InvertedListCursorFactory.java
index 530686d..07cffcf 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/InvertedListCursorFactory.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/InvertedListCursorFactory.java
@@ -19,15 +19,15 @@
 
 package org.apache.hyracks.storage.am.lsm.invertedindex.search;
 
-import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndex;
+import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexComponent;
 import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedListCursor;
 import org.apache.hyracks.storage.am.lsm.invertedindex.api.IObjectFactory;
 
 public class InvertedListCursorFactory implements 
IObjectFactory<IInvertedListCursor> {
 
-    private final IInvertedIndex invIndex;
+    private final IInvertedIndexComponent invIndex;
 
-    public InvertedListCursorFactory(IInvertedIndex invIndex) {
+    public InvertedListCursorFactory(IInvertedIndexComponent invIndex) {
         this.invIndex = invIndex;
     }
 
diff --git 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/PartitionedTOccurrenceSearcher.java
 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/PartitionedTOccurrenceSearcher.java
index 9221e1f..5137c37 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/PartitionedTOccurrenceSearcher.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/PartitionedTOccurrenceSearcher.java
@@ -31,7 +31,7 @@
 import org.apache.hyracks.dataflow.common.data.accessors.ITupleReference;
 import org.apache.hyracks.storage.am.common.api.IIndexOperationContext;
 import org.apache.hyracks.storage.am.common.tuples.ConcatenatingTupleReference;
-import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndex;
+import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexComponent;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexSearchModifier;
 import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedListCursor;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IPartitionedInvertedIndex;
@@ -52,7 +52,7 @@
     protected final ArrayList<IInvertedListCursor> cursorsOrderedByTokens = 
new ArrayList<>();
     protected final InvertedListPartitions partitions = new 
InvertedListPartitions();
 
-    public PartitionedTOccurrenceSearcher(IHyracksCommonContext ctx, 
IInvertedIndex invIndex)
+    public PartitionedTOccurrenceSearcher(IHyracksCommonContext ctx, 
IInvertedIndexComponent invIndex)
             throws HyracksDataException {
         super(ctx, invIndex);
         initHelperTuples();
diff --git 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/TOccurrenceSearcher.java
 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/TOccurrenceSearcher.java
index 508a51d..4b3bd8a 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/TOccurrenceSearcher.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/search/TOccurrenceSearcher.java
@@ -25,7 +25,7 @@
 import org.apache.hyracks.api.exceptions.ErrorCode;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.storage.am.common.api.IIndexOperationContext;
-import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndex;
+import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexComponent;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexSearchModifier;
 import org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedListCursor;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.ondisk.OnDiskInvertedIndexSearchCursor;
@@ -34,7 +34,8 @@
 
     protected final ArrayList<IInvertedListCursor> invListCursors = new 
ArrayList<>();
 
-    public TOccurrenceSearcher(IHyracksCommonContext ctx, IInvertedIndex 
invIndex) throws HyracksDataException {
+    public TOccurrenceSearcher(IHyracksCommonContext ctx, 
IInvertedIndexComponent invIndex)
+            throws HyracksDataException {
         super(ctx, invIndex);
     }
 

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1852
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0fb7b446edfb14de25ecaf99965ae0a7325101c9
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: abdullah alamoudi <bamou...@gmail.com>

Reply via email to