lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpou...@apache.org
Subject svn commit: r1643089 - in /lucene/dev/branches/branch_5x: ./ lucene/ lucene/core/ lucene/core/src/java/org/apache/lucene/search/ lucene/core/src/test/org/apache/lucene/search/
Date Mon, 15 Dec 2014 17:12:27 GMT
Author: jpountz
Date: Wed Dec  3 10:52:11 2014
New Revision: 1643089

URL: http://svn.apache.org/r1643089
Log:
LUCENE-6091: Fix UsageTrackingFilterCachingPolicy's handling of null DocIdSets.

Added:
    lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/search/TestFilterCachingPolicy.java
      - copied unchanged from r1643085, lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/search/TestFilterCachingPolicy.java
    lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/search/TestUsageTrackingFilterCachingPolicy.java
      - copied unchanged from r1643085, lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/search/TestUsageTrackingFilterCachingPolicy.java
Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/lucene/   (props changed)
    lucene/dev/branches/branch_5x/lucene/core/   (props changed)
    lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/UsageTrackingFilterCachingPolicy.java

Modified: lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/UsageTrackingFilterCachingPolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/UsageTrackingFilterCachingPolicy.java?rev=1643089&r1=1643088&r2=1643089&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/UsageTrackingFilterCachingPolicy.java
(original)
+++ lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/UsageTrackingFilterCachingPolicy.java
Wed Dec  3 10:52:11 2014
@@ -36,18 +36,18 @@ import org.apache.lucene.util.FrequencyT
  */
 public final class UsageTrackingFilterCachingPolicy implements FilterCachingPolicy {
 
-  private static boolean isCostly(Filter filter) {
+  static boolean isCostly(Filter filter) {
     // This does not measure the cost of iterating over the filter (for this we
     // already have the DocIdSetIterator#cost API) but the cost to build the
     // DocIdSet in the first place
     return filter instanceof MultiTermQueryWrapperFilter;
   }
 
-  private static boolean isCheapToCache(DocIdSet set) {
+  static boolean isCheapToCache(DocIdSet set) {
     // the produced doc set is already cacheable, so caching has no
     // overhead at all. TODO: extend this to sets whose iterators have a low
     // cost?
-    return set.isCacheable();
+    return set == null || set.isCacheable();
   }
 
   private final FilterCachingPolicy.CacheOnLargeSegments segmentPolicy;



Mime
View raw message