You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2014/09/08 12:13:10 UTC
svn commit: r1623349 - in /lucene/dev/branches/branch_4x: ./ lucene/
lucene/CHANGES.txt lucene/core/
lucene/core/src/java/org/apache/lucene/search/FieldCacheDocIdSet.java
lucene/core/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java
Author: jpountz
Date: Mon Sep 8 10:13:09 2014
New Revision: 1623349
URL: http://svn.apache.org/r1623349
Log:
LUCENE-5922: FieldCacheDocIdSet is not cacheable.
Modified:
lucene/dev/branches/branch_4x/ (props changed)
lucene/dev/branches/branch_4x/lucene/ (props changed)
lucene/dev/branches/branch_4x/lucene/CHANGES.txt (contents, props changed)
lucene/dev/branches/branch_4x/lucene/core/ (props changed)
lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/search/FieldCacheDocIdSet.java
lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java
Modified: lucene/dev/branches/branch_4x/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/CHANGES.txt?rev=1623349&r1=1623348&r2=1623349&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/lucene/CHANGES.txt Mon Sep 8 10:13:09 2014
@@ -58,6 +58,9 @@ Bug Fixes
possibly deleting a file that's still in use in the index, leading
to corruption. (Mike McCandless)
+* LUCENE-5922: DocValuesDocIdSet on 5.x and FieldCacheDocIdSet on 4.x
+ are not cacheable. (Adrien Grand)
+
Build
* LUCENE-5909: Smoke tester now has better command line parsing and
Modified: lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/search/FieldCacheDocIdSet.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/search/FieldCacheDocIdSet.java?rev=1623349&r1=1623348&r2=1623349&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/search/FieldCacheDocIdSet.java (original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/search/FieldCacheDocIdSet.java Mon Sep 8 10:13:09 2014
@@ -45,15 +45,6 @@ public abstract class FieldCacheDocIdSet
*/
protected abstract boolean matchDoc(int doc);
- /**
- * this DocIdSet is always cacheable (does not go back
- * to the reader for iteration)
- */
- @Override
- public final boolean isCacheable() {
- return true;
- }
-
@Override
public final Bits bits() {
return (acceptDocs == null) ? new Bits() {
Modified: lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java?rev=1623349&r1=1623348&r2=1623349&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java (original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java Mon Sep 8 10:13:09 2014
@@ -35,7 +35,7 @@ import org.apache.lucene.util.Bits;
import org.apache.lucene.util.FixedBitSet;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.LuceneTestCase;
-import org.apache.lucene.util.TestUtil;
+import org.apache.lucene.util.WAH8DocIdSet;
public class TestCachingWrapperFilter extends LuceneTestCase {
Directory dir;
@@ -235,7 +235,7 @@ public class TestCachingWrapperFilter ex
if (originalSet.isCacheable()) {
assertEquals("Cached DocIdSet must be of same class like uncached, if cacheable", originalSet.getClass(), cachedSet.getClass());
} else {
- assertTrue("Cached DocIdSet must be an FixedBitSet if the original one was not cacheable", cachedSet instanceof FixedBitSet || cachedSet == null);
+ assertTrue("Cached DocIdSet must be an WAH8DocIdSet if the original one was not cacheable", cachedSet instanceof WAH8DocIdSet || cachedSet == null);
}
}
}
@@ -253,7 +253,7 @@ public class TestCachingWrapperFilter ex
// returns default empty docidset, always cacheable:
assertDocIdSetCacheable(reader, NumericRangeFilter.newIntRange("test", Integer.valueOf(10000), Integer.valueOf(-10000), true, true), true);
// is cacheable:
- assertDocIdSetCacheable(reader, FieldCacheRangeFilter.newIntRange("test", Integer.valueOf(10), Integer.valueOf(20), true, true), true);
+ assertDocIdSetCacheable(reader, FieldCacheRangeFilter.newIntRange("test", Integer.valueOf(10), Integer.valueOf(20), true, true), false);
// a fixedbitset filter is always cacheable
assertDocIdSetCacheable(reader, new Filter() {
@Override