geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ash...@apache.org
Subject [11/50] [abbrv] incubator-geode git commit: Removing ResultType from LuceneQueryFactory
Date Wed, 11 Nov 2015 21:23:43 GMT
Removing ResultType from LuceneQueryFactory

ResultType is not necessary since there is no performance gain to be had
by not including the key or score, and the presence of the value is
controlled by setProjectionFields.


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

Branch: refs/heads/develop
Commit: db5db7a17c2c301ab35a8bc0c23fe6be8cc0741c
Parents: 9ca4e78
Author: Dan Smith <upthewaterspout@apache.org>
Authored: Wed Sep 23 11:10:11 2015 -0700
Committer: Dan Smith <upthewaterspout@apache.org>
Committed: Wed Sep 23 11:10:11 2015 -0700

----------------------------------------------------------------------
 .../gemfire/cache/lucene/LuceneQuery.java       |  7 ------
 .../cache/lucene/LuceneQueryFactory.java        | 26 --------------------
 .../lucene/internal/LuceneQueryFactoryImpl.java | 14 +----------
 .../cache/lucene/internal/LuceneQueryImpl.java  | 10 +-------
 4 files changed, 2 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db5db7a1/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQuery.java
----------------------------------------------------------------------
diff --git a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQuery.java
b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQuery.java
index 57ce386..548bb00 100644
--- a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQuery.java
+++ b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQuery.java
@@ -1,7 +1,5 @@
 package com.gemstone.gemfire.cache.lucene;
 
-import com.gemstone.gemfire.cache.lucene.LuceneQueryFactory.ResultType;
-
 /**
  * Provides wrapper object of Lucene's Query object and execute the search. 
  * <p>Instances of this interface are created using
@@ -25,11 +23,6 @@ public interface LuceneQuery {
   public int getLimit();
 
   /**
-   * Get result types setting of current query. 
-   */
-  public ResultType[] getResultTypes();
-  
-  /**
    * Get projected fields setting of current query. 
    */
   public String[] getProjectedFieldNames();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db5db7a1/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryFactory.java
----------------------------------------------------------------------
diff --git a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryFactory.java
b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryFactory.java
index 4bb8180..1775b40 100644
--- a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryFactory.java
+++ b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/LuceneQueryFactory.java
@@ -25,24 +25,6 @@ public interface LuceneQueryFactory {
    */
   public static final int DEFAULT_PAGESIZE = 0;
   
-  public enum ResultType {
-    /**
-     *  Query results only contain value, which is the default setting.
-     *  If field projection is specified, use projected fields' values instead of whole domain
object
-     */
-    VALUE,
-    
-    /**
-     * Query results contain score
-     */
-    SCORE,
-    
-    /**
-     * Query results contain key
-     */
-    KEY
-  };
-
   /**
    * Set page size for a query result. The default page size is 0 which means no pagination.
    * If specified negative value, throw IllegalArgumentException
@@ -60,14 +42,6 @@ public interface LuceneQueryFactory {
   LuceneQueryFactory setResultLimit(int limit);
   
   /**
-   * set weather to include SCORE, KEY in result
-   * 
-   * @param resultTypes
-   * @return itself
-   */
-  LuceneQueryFactory setResultTypes(ResultType... resultTypes);
-  
-  /**
    * Set a list of fields for result projection.
    * 
    * @param fieldNames

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db5db7a1/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryFactoryImpl.java
----------------------------------------------------------------------
diff --git a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryFactoryImpl.java
b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryFactoryImpl.java
index 8bb18e8..f5d38bc 100644
--- a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryFactoryImpl.java
+++ b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryFactoryImpl.java
@@ -17,7 +17,6 @@ import com.gemstone.gemfire.cache.lucene.LuceneQueryProvider;
 public class LuceneQueryFactoryImpl implements LuceneQueryFactory {
   private int limit_attr = DEFAULT_LIMIT;
   private int pageSize_attr = DEFAULT_PAGESIZE;
-  private Set<ResultType> resultType_attr = new HashSet<ResultType>();
   private Set<String> projection_fields_attr = new HashSet<String>();
   
   /* reference to the index. One index could have multiple Queries, but one Query must belong
@@ -38,22 +37,11 @@ public class LuceneQueryFactoryImpl implements LuceneQueryFactory {
   }
 
   @Override
-  public LuceneQueryFactory setResultTypes(ResultType... resultTypes) {
-    if (resultTypes != null) {
-      for (ResultType resultType:resultTypes) {
-        this.resultType_attr.add(resultType);
-      }
-    }
-    return this;
-  }
-
-  @Override
   public LuceneQuery create(String indexName, String regionName,
       String queryString, Analyzer analyzer) throws ParseException {
     QueryParser parser = new QueryParser(null, analyzer);
     Query query = parser.parse(queryString);
-    LuceneQueryImpl luceneQuery = new LuceneQueryImpl(indexName, regionName, limit_attr,
pageSize_attr, 
-        resultType_attr, projection_fields_attr, query);
+    LuceneQueryImpl luceneQuery = new LuceneQueryImpl(indexName, regionName, limit_attr,
pageSize_attr, projection_fields_attr, query);
     return luceneQuery;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db5db7a1/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryImpl.java
----------------------------------------------------------------------
diff --git a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryImpl.java
b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryImpl.java
index 27f0ea6..e93692f 100644
--- a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryImpl.java
+++ b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneQueryImpl.java
@@ -6,7 +6,6 @@ import org.apache.lucene.search.Query;
 
 import com.gemstone.gemfire.cache.lucene.LuceneQuery;
 import com.gemstone.gemfire.cache.lucene.LuceneQueryFactory;
-import com.gemstone.gemfire.cache.lucene.LuceneQueryFactory.ResultType;
 import com.gemstone.gemfire.cache.lucene.LuceneQueryResults;
 
 public class LuceneQueryImpl implements LuceneQuery {
@@ -14,7 +13,6 @@ public class LuceneQueryImpl implements LuceneQuery {
   private int pageSize = LuceneQueryFactory.DEFAULT_PAGESIZE;
   private String indexName;
   private String regionName;
-  private Set<ResultType> resultTypes;
   
   // The projected fields are local to a specific index per Query object. 
   private Set<String> projectedFieldNames;
@@ -22,13 +20,12 @@ public class LuceneQueryImpl implements LuceneQuery {
   /* the lucene Query object to be wrapped here */
   private Query query;
   
-  LuceneQueryImpl(String indexName, String regionName, int limit, int pageSize, Set<ResultType>
resultTypes, 
+  LuceneQueryImpl(String indexName, String regionName, int limit, int pageSize, 
       Set<String> projectionFieldNames, Query query) {
     this.indexName = indexName;
     this.regionName = regionName;
     this.limit = limit;
     this.pageSize = pageSize;
-    this.resultTypes = resultTypes;
     this.projectedFieldNames = projectionFieldNames;
     this.query = query;
   }
@@ -50,11 +47,6 @@ public class LuceneQueryImpl implements LuceneQuery {
   }
 
   @Override
-  public ResultType[] getResultTypes() {
-    return (ResultType[])this.resultTypes.toArray();
-  }
-
-  @Override
   public String[] getProjectedFieldNames() {
     return (String[])this.projectedFieldNames.toArray();
   }


Mime
View raw message