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:
Uwe Schindler 2012-01-29 20:00:00 +00:00
parent c1d1dfbabf
commit e7f5029e00
2 changed files with 16 additions and 0 deletions

View File

@ -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?

View File

@ -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);