incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [01/27] git commit: Fixed BLUR-170
Date Mon, 29 Jul 2013 12:57:32 GMT
Updated Branches:
  refs/heads/0.2.0-newtypesystem ae516a442 -> fb0ece57b


Fixed BLUR-170


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

Branch: refs/heads/0.2.0-newtypesystem
Commit: a726ca549b807854b3618809f012ea598952f980
Parents: 84eb05a
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Tue Jul 16 14:19:09 2013 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Tue Jul 16 14:19:09 2013 -0400

----------------------------------------------------------------------
 .../java/org/apache/blur/manager/IndexManager.java   | 15 +++++++++++----
 .../manager/results/BlurResultIterableSearcher.java  |  5 +++--
 .../apache/blur/thrift/ThriftBlurShardServer.java    |  1 +
 .../java/org/apache/blur/utils/BlurConstants.java    |  1 +
 blur-util/src/main/resources/blur-default.properties |  1 +
 5 files changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a726ca54/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java b/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
index 368aa75..b9a8b1c 100644
--- a/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
+++ b/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
@@ -142,6 +142,7 @@ public class IndexManager {
   private Meter _queriesExternalMeter;
   private Meter _queriesInternalMeter;
   private Timer _fetchTimer;
+  private int _fetchCount = 100;
 
   public static AtomicBoolean DEBUG_RUN_SLOW = new AtomicBoolean(false);
 
@@ -386,7 +387,7 @@ public class IndexManager {
         Query facetedQuery = getFacetedQuery(blurQuery, userQuery, facetedCounts, analyzer,
context, postFilter,
             preFilter);
         call = new SimpleQueryParallelCall(running, table, status, _indexServer, facetedQuery,
blurQuery.selector,
-            _queriesInternalMeter, shardServerContext, runSlow);
+            _queriesInternalMeter, shardServerContext, runSlow, _fetchCount);
       } else {
         Query query = getQuery(blurQuery.expertQuery);
         Filter filter = getFilter(blurQuery.expertQuery);
@@ -398,7 +399,7 @@ public class IndexManager {
         }
         Query facetedQuery = getFacetedQuery(blurQuery, userQuery, facetedCounts, analyzer,
context, null, null);
         call = new SimpleQueryParallelCall(running, table, status, _indexServer, facetedQuery,
blurQuery.selector,
-            _queriesInternalMeter, shardServerContext, runSlow);
+            _queriesInternalMeter, shardServerContext, runSlow, _fetchCount);
       }
       MergerBlurResultIterable merger = new MergerBlurResultIterable(blurQuery);
       return ForkJoin.execute(_executor, blurIndexes.entrySet(), call, new Cancel() {
@@ -1071,10 +1072,11 @@ public class IndexManager {
     private final Meter _queriesInternalMeter;
     private final ShardServerContext _shardServerContext;
     private final boolean _runSlow;
+    private final int _fetchCount;
 
     public SimpleQueryParallelCall(AtomicBoolean running, String table, QueryStatus status,
IndexServer indexServer,
         Query query, Selector selector, Meter queriesInternalMeter, ShardServerContext shardServerContext,
-        boolean runSlow) {
+        boolean runSlow, int fetchCount) {
       _running = running;
       _table = table;
       _status = status;
@@ -1084,6 +1086,7 @@ public class IndexManager {
       _queriesInternalMeter = queriesInternalMeter;
       _shardServerContext = shardServerContext;
       _runSlow = runSlow;
+      _fetchCount = fetchCount;
     }
 
     @Override
@@ -1115,7 +1118,7 @@ public class IndexManager {
         // BlurResultIterableSearcher will close searcher, if shard server
         // context is null.
         return new BlurResultIterableSearcher(_running, rewrite, _table, shard, searcher,
_selector,
-            _shardServerContext == null, _runSlow);
+            _shardServerContext == null, _runSlow, _fetchCount);
       } catch (BlurException e) {
         switch (_status.getQueryStatus().getState()) {
         case INTERRUPTED:
@@ -1166,5 +1169,9 @@ public class IndexManager {
   public void setClusterStatus(ClusterStatus clusterStatus) {
     _clusterStatus = clusterStatus;
   }
+  
+  public void setFetchCount(int fetchCount) {
+    _fetchCount = fetchCount;
+  }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a726ca54/blur-core/src/main/java/org/apache/blur/manager/results/BlurResultIterableSearcher.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/manager/results/BlurResultIterableSearcher.java
b/blur-core/src/main/java/org/apache/blur/manager/results/BlurResultIterableSearcher.java
index fdff075..2fab74f 100644
--- a/blur-core/src/main/java/org/apache/blur/manager/results/BlurResultIterableSearcher.java
+++ b/blur-core/src/main/java/org/apache/blur/manager/results/BlurResultIterableSearcher.java
@@ -43,7 +43,7 @@ public class BlurResultIterableSearcher implements BlurResultIterable {
   private String _shard;
   private long _skipTo;
   private String _table;
-  private int _fetchCount = 1000;
+  private final int _fetchCount;
 
   private IteratorConverter<ScoreDoc, BlurResult, BlurException> _iterator;
   private final Selector _selector;
@@ -56,7 +56,7 @@ public class BlurResultIterableSearcher implements BlurResultIterable {
   private final boolean _runSlow;
 
   public BlurResultIterableSearcher(AtomicBoolean running, Query query, String table, String
shard,
-      IndexSearcherClosable searcher, Selector selector, boolean closeSearcher, boolean runSlow)
throws BlurException {
+      IndexSearcherClosable searcher, Selector selector, boolean closeSearcher, boolean runSlow,
int fetchCount) throws BlurException {
     _running = running;
     _table = table;
     _query = query;
@@ -65,6 +65,7 @@ public class BlurResultIterableSearcher implements BlurResultIterable {
     _selector = selector;
     _closeSearcher = closeSearcher;
     _runSlow = runSlow;
+    _fetchCount = fetchCount;
     performSearch();
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a726ca54/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurShardServer.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurShardServer.java b/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurShardServer.java
index e37fc90..25f2f0c 100644
--- a/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurShardServer.java
+++ b/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurShardServer.java
@@ -206,6 +206,7 @@ public class ThriftBlurShardServer extends ThriftServer {
     indexManager.setThreadCount(configuration.getInt(BLUR_INDEXMANAGER_SEARCH_THREAD_COUNT,
32));
     indexManager.setFilterCache(filterCache);
     indexManager.setClusterStatus(clusterStatus);
+    indexManager.setFetchCount(configuration.getInt(BLUR_SHARD_FETCHCOUNT, 100));
     indexManager.init();
 
     final BlurShardServer shardServer = new BlurShardServer();

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a726ca54/blur-util/src/main/java/org/apache/blur/utils/BlurConstants.java
----------------------------------------------------------------------
diff --git a/blur-util/src/main/java/org/apache/blur/utils/BlurConstants.java b/blur-util/src/main/java/org/apache/blur/utils/BlurConstants.java
index 5af88e7..50a819e 100644
--- a/blur-util/src/main/java/org/apache/blur/utils/BlurConstants.java
+++ b/blur-util/src/main/java/org/apache/blur/utils/BlurConstants.java
@@ -52,6 +52,7 @@ public class BlurConstants {
   public static final String BLUR_QUERY_MAX_ROW_FETCH = "blur.query.max.row.fetch";
   public static final String BLUR_QUERY_MAX_RECORD_FETCH = "blur.query.max.record.fetch";
   public static final String BLUR_QUERY_MAX_RESULTS_FETCH = "blur.query.max.results.fetch";
+  public static final String BLUR_SHARD_FETCHCOUNT = "blur.shard.fetchcount";
 
   public static final String BLUR_SHARD_SERVER_THRIFT_THREAD_COUNT = "blur.shard.server.thrift.thread.count";
   public static final String BLUR_SHARD_CACHE_MAX_TIMETOLIVE = "blur.shard.cache.max.timetolive";

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a726ca54/blur-util/src/main/resources/blur-default.properties
----------------------------------------------------------------------
diff --git a/blur-util/src/main/resources/blur-default.properties b/blur-util/src/main/resources/blur-default.properties
index 39b3d7c..ce9ca98 100644
--- a/blur-util/src/main/resources/blur-default.properties
+++ b/blur-util/src/main/resources/blur-default.properties
@@ -35,6 +35,7 @@ blur.max.clause.count=1024
 blur.indexmanager.search.thread.count=8
 blur.shard.internal.search.thread.count=8
 blur.shard.warmup.thread.count=8
+blur.shard.fetchcount=100
 
 blur.controller.hostname=
 blur.controller.bind.address=0.0.0.0


Mime
View raw message