LUCENE-2858: fix remaining nocommits

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene2858@1238050 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2012-01-30 22:31:51 +00:00
parent 13a061943c
commit 57e33cf135
7 changed files with 9 additions and 12 deletions

View File

@ -160,7 +160,7 @@ public final class SlowCompositeReaderWrapper extends AtomicReader {
@Override @Override
protected void doClose() throws IOException { protected void doClose() throws IOException {
// nocommit: as this is a wrapper, should we really close the delegate? // TODO: as this is a wrapper, should we really close the delegate?
in.close(); in.close();
} }
} }

View File

@ -109,7 +109,6 @@ public class SearcherLifetimeManager implements Closeable {
public SearcherTracker(IndexSearcher searcher) { public SearcherTracker(IndexSearcher searcher) {
this.searcher = searcher; this.searcher = searcher;
// nocommit: what happens if this is no DirectoryReader?
version = ((DirectoryReader) searcher.getIndexReader()).getVersion(); version = ((DirectoryReader) searcher.getIndexReader()).getVersion();
searcher.getIndexReader().incRef(); searcher.getIndexReader().incRef();
// Use nanoTime not currentTimeMillis since it [in // Use nanoTime not currentTimeMillis since it [in
@ -169,7 +168,6 @@ public class SearcherLifetimeManager implements Closeable {
// TODO: we don't have to use IR.getVersion to track; // TODO: we don't have to use IR.getVersion to track;
// could be risky (if it's buggy); we could get better // could be risky (if it's buggy); we could get better
// bug isolation if we assign our own private ID: // bug isolation if we assign our own private ID:
// nocommit: fix getVersion() usage for atomic readers
final long version = ((DirectoryReader) searcher.getIndexReader()).getVersion(); final long version = ((DirectoryReader) searcher.getIndexReader()).getVersion();
SearcherTracker tracker = searchers.get(version); SearcherTracker tracker = searchers.get(version);
if (tracker == null) { if (tracker == null) {

View File

@ -116,8 +116,7 @@ public class CheckHits {
Assert.assertEquals("Wrap Reader " + i + ": " + Assert.assertEquals("Wrap Reader " + i + ": " +
query.toString(defaultFieldName), query.toString(defaultFieldName),
correct, actual); correct, actual);
// nocommit: I removed that as we can never get insanity by composite readers anymore... Is this ok? // TODO: FieldCache.DEFAULT.purge(s.getIndexReader()); // our wrapping can create insanity otherwise
//FieldCache.DEFAULT.purge(s.getIndexReader()); // our wrapping can create insanity otherwise
} }
} }

View File

@ -116,13 +116,13 @@ public class QueryUtils {
if (wrap) { if (wrap) {
IndexSearcher wrapped; IndexSearcher wrapped;
check(random, q1, wrapped = wrapUnderlyingReader(random, s, -1), false); check(random, q1, wrapped = wrapUnderlyingReader(random, s, -1), false);
// nocommit: I removed that as we can never get insanity by composite readers anymore... Is this ok? // TODO: I removed that as we can never get insanity by composite readers anymore... Is this ok?
//FieldCache.DEFAULT.purge(wrapped.getIndexReader()); // our wrapping can create insanity otherwise //FieldCache.DEFAULT.purge(wrapped.getIndexReader()); // our wrapping can create insanity otherwise
check(random, q1, wrapped = wrapUnderlyingReader(random, s, 0), false); check(random, q1, wrapped = wrapUnderlyingReader(random, s, 0), false);
// nocommit: I removed that as we can never get insanity by composite readers anymore... Is this ok? // TODO: I removed that as we can never get insanity by composite readers anymore... Is this ok?
//FieldCache.DEFAULT.purge(wrapped.getIndexReader()); // our wrapping can create insanity otherwise //FieldCache.DEFAULT.purge(wrapped.getIndexReader()); // our wrapping can create insanity otherwise
check(random, q1, wrapped = wrapUnderlyingReader(random, s, +1), false); check(random, q1, wrapped = wrapUnderlyingReader(random, s, +1), false);
// nocommit: I removed that as we can never get insanity by composite readers anymore... Is this ok? // TODO: I removed that as we can never get insanity by composite readers anymore... Is this ok?
//FieldCache.DEFAULT.purge(wrapped.getIndexReader()); // our wrapping can create insanity otherwise //FieldCache.DEFAULT.purge(wrapped.getIndexReader()); // our wrapping can create insanity otherwise
} }
checkExplanations(q1,s); checkExplanations(q1,s);

View File

@ -86,7 +86,7 @@ public class TestDirectoryReader extends LuceneTestCase {
assertTrue(DocHelper.numFields(newDoc2) == DocHelper.numFields(doc2) - DocHelper.unstored.size()); assertTrue(DocHelper.numFields(newDoc2) == DocHelper.numFields(doc2) - DocHelper.unstored.size());
Terms vector = reader.getTermVectors(0).terms(DocHelper.TEXT_FIELD_2_KEY); Terms vector = reader.getTermVectors(0).terms(DocHelper.TEXT_FIELD_2_KEY);
assertNotNull(vector); assertNotNull(vector);
// nocommit: pretty sure this check makes zero sense TestSegmentReader.checkNorms(reader); // TODO: pretty sure this check makes zero sense TestSegmentReader.checkNorms(reader);
reader.close(); reader.close();
} }

View File

@ -366,7 +366,7 @@ public class AllGroupHeadsCollectorTest extends LuceneTestCase {
} }
} }
} finally { } finally {
// nocommit FieldCache.DEFAULT.purge(r); // TODO: FieldCache.DEFAULT.purge(r);
} }
r.close(); r.close();

View File

@ -1140,9 +1140,9 @@ public class TestGrouping extends LuceneTestCase {
assertEquals(docIDToIDBlocks, expectedGroups, topGroupsBlockShards, false, false, fillFields, getScores, false); assertEquals(docIDToIDBlocks, expectedGroups, topGroupsBlockShards, false, false, fillFields, getScores, false);
} }
} finally { } finally {
// nocommit FieldCache.DEFAULT.purge(r); // TODO: FieldCache.DEFAULT.purge(r);
if (rBlocks != null) { if (rBlocks != null) {
// nocommit FieldCache.DEFAULT.purge(rBlocks); // TODO: FieldCache.DEFAULT.purge(rBlocks);
} }
} }