mirror of https://github.com/apache/lucene.git
LUCENE-2858: Make Slow* use the inner cache key
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene2858@1237443 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c1d1dfbabf
commit
e7f5029e00
|
@ -148,6 +148,16 @@ public final class SlowCompositeReaderWrapper extends AtomicIndexReader {
|
|||
return liveDocs != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getCoreCacheKey() {
|
||||
return in.getCoreCacheKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getCombinedCoreAndDeletesKey() {
|
||||
return in.getCombinedCoreAndDeletesKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doClose() throws IOException {
|
||||
// nocommit: as this is a wrapper, should we really close the delegate?
|
||||
|
|
|
@ -36,6 +36,7 @@ public class TestFieldCacheSanityChecker extends LuceneTestCase {
|
|||
protected AtomicIndexReader readerA;
|
||||
protected AtomicIndexReader readerB;
|
||||
protected AtomicIndexReader readerX;
|
||||
protected AtomicIndexReader readerAclone;
|
||||
protected Directory dirA, dirB;
|
||||
private static final int NUM_DOCS = 1000;
|
||||
|
||||
|
@ -70,6 +71,9 @@ public class TestFieldCacheSanityChecker extends LuceneTestCase {
|
|||
}
|
||||
wA.close();
|
||||
wB.close();
|
||||
DirectoryReader rA = DirectoryReader.open(dirA);
|
||||
readerA = SlowCompositeReaderWrapper.wrap(rA);
|
||||
readerAclone = SlowCompositeReaderWrapper.wrap(rA);
|
||||
readerA = SlowCompositeReaderWrapper.wrap(DirectoryReader.open(dirA));
|
||||
readerB = SlowCompositeReaderWrapper.wrap(DirectoryReader.open(dirB));
|
||||
readerX = SlowCompositeReaderWrapper.wrap(new MultiReader(readerA, readerB));
|
||||
|
@ -78,6 +82,7 @@ public class TestFieldCacheSanityChecker extends LuceneTestCase {
|
|||
@Override
|
||||
public void tearDown() throws Exception {
|
||||
readerA.close();
|
||||
readerAclone.close();
|
||||
readerB.close();
|
||||
readerX.close();
|
||||
dirA.close();
|
||||
|
@ -91,6 +96,7 @@ public class TestFieldCacheSanityChecker extends LuceneTestCase {
|
|||
|
||||
cache.getDoubles(readerA, "theDouble", false);
|
||||
cache.getDoubles(readerA, "theDouble", FieldCache.DEFAULT_DOUBLE_PARSER, false);
|
||||
cache.getDoubles(readerAclone, "theDouble", FieldCache.DEFAULT_DOUBLE_PARSER, false);
|
||||
cache.getDoubles(readerB, "theDouble", FieldCache.DEFAULT_DOUBLE_PARSER, false);
|
||||
|
||||
cache.getInts(readerX, "theInt", false);
|
||||
|
|
Loading…
Reference in New Issue