incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [50/50] [abbrv] git commit: Fixing some errors.
Date Sun, 03 Nov 2013 15:20:44 GMT
Fixing some errors.


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

Branch: refs/heads/0.3.0-lucene-upgrade
Commit: 3f6f7f332fd736c0bfb9290609be64629b68974d
Parents: 9c7e5f3
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Sun Nov 3 10:19:16 2013 -0500
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Sun Nov 3 10:19:16 2013 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/blur/filter/FilterCache.java    | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/3f6f7f33/blur-query/src/main/java/org/apache/blur/filter/FilterCache.java
----------------------------------------------------------------------
diff --git a/blur-query/src/main/java/org/apache/blur/filter/FilterCache.java b/blur-query/src/main/java/org/apache/blur/filter/FilterCache.java
index 667af7f..80be12a 100644
--- a/blur-query/src/main/java/org/apache/blur/filter/FilterCache.java
+++ b/blur-query/src/main/java/org/apache/blur/filter/FilterCache.java
@@ -38,6 +38,13 @@ public class FilterCache extends Filter {
 
   private static final Log LOG = LogFactory.getLog(FilterCache.class);
 
+  private static final DocIdSet EMPTY_DOCIDSET = new DocIdSet() {
+    @Override
+    public DocIdSetIterator iterator() throws IOException {
+      return DocIdSetIterator.empty();
+    }
+  };
+
   private final Map<Object, DocIdSet> _cache = Collections.synchronizedMap(new WeakHashMap<Object,
DocIdSet>());
   private final Map<Object, Object> _lockMap = Collections.synchronizedMap(new WeakHashMap<Object,
Object>());
   private final Filter _filter;
@@ -93,7 +100,7 @@ public class FilterCache extends Filter {
       throws IOException {
     if (docIdSet == null) {
       // this is better than returning null, as the nonnull result can be cached
-      return DocIdSet.EMPTY_DOCIDSET;
+      return EMPTY_DOCIDSET;
     } else if (docIdSet.isCacheable()) {
       return docIdSet;
     } else {
@@ -102,7 +109,7 @@ public class FilterCache extends Filter {
       // in this case we wrap with the empty set,
       // which is cacheable.
       if (it == null) {
-        return DocIdSet.EMPTY_DOCIDSET;
+        return EMPTY_DOCIDSET;
       } else {
         final IndexFileBitSet bits = new IndexFileBitSet(reader.maxDoc(), _id, segmentName,
directory);
         if (!bits.exists()) {


Mime
View raw message