incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject git commit: Small cleanup of last commit.
Date Wed, 19 Jun 2013 01:50:57 GMT
Updated Branches:
  refs/heads/master c921b55f6 -> f04297024


Small cleanup of last commit.


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

Branch: refs/heads/master
Commit: f04297024faee900d0cc711db9e99e08ba9b4b12
Parents: c921b55
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Tue Jun 18 21:50:45 2013 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Tue Jun 18 21:50:45 2013 -0400

----------------------------------------------------------------------
 .../src/main/java/org/apache/blur/manager/IndexManager.java | 9 ++++++++-
 .../src/main/java/org/apache/blur/index/ExitableReader.java | 6 +++---
 2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f0429702/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 e8bc5f4..1063b7f 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
@@ -48,6 +48,7 @@ import java.util.concurrent.atomic.AtomicLongArray;
 import org.apache.blur.analysis.BlurAnalyzer;
 import org.apache.blur.concurrent.Executors;
 import org.apache.blur.index.ExitableReader;
+import org.apache.blur.index.ExitableReader.ExitingReaderException;
 import org.apache.blur.log.Log;
 import org.apache.blur.log.LogFactory;
 import org.apache.blur.lucene.search.FacetQuery;
@@ -1066,7 +1067,13 @@ public class IndexManager {
           _shardServerContext.setIndexSearcherClosable(_table, shard, searcher);
         }
         searcher.setSimilarity(_indexServer.getSimilarity(_table));
-        Query rewrite = searcher.rewrite((Query) _query.clone());
+        Query rewrite;
+        try {
+          rewrite = searcher.rewrite((Query) _query.clone());
+        } catch (ExitingReaderException e) {
+          LOG.info("Query [{0}] has been cancelled during the rewrite phase.", _query);
+          throw e;
+        }
 
         // BlurResultIterableSearcher will close searcher, if shard server
         // context is null.

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f0429702/blur-store/src/main/java/org/apache/blur/index/ExitableReader.java
----------------------------------------------------------------------
diff --git a/blur-store/src/main/java/org/apache/blur/index/ExitableReader.java b/blur-store/src/main/java/org/apache/blur/index/ExitableReader.java
index dd8bf36..f78ce72 100644
--- a/blur-store/src/main/java/org/apache/blur/index/ExitableReader.java
+++ b/blur-store/src/main/java/org/apache/blur/index/ExitableReader.java
@@ -40,12 +40,12 @@ import org.apache.lucene.util.automaton.CompiledAutomaton;
  * The {@link DirectoryReader} wraps a real index {@link DirectoryReader} and
  * allows for a {@link AtomicBoolean} to be checked periodically to see if the
  * thread should exit or not. The exit mechanism is by throw a
- * {@link ExitingReader} exception.
+ * {@link ExitingReaderException} exception.
  */
 public class ExitableReader extends FilterDirectoryReader {
 
   @SuppressWarnings("serial")
-  public static class ExitingReader extends RuntimeException {
+  public static class ExitingReaderException extends RuntimeException {
 
   }
 
@@ -211,7 +211,7 @@ public class ExitableReader extends FilterDirectoryReader {
 
     private void checkAndThrow() {
       if (!_running.get()) {
-        throw new ExitingReader();
+        throw new ExitingReaderException();
       }
     }
 


Mime
View raw message