Module org.apache.lucene.misc
Package org.apache.lucene.misc.index
Class MultiPassIndexSplitter.FakeDeleteIndexReader
java.lang.Object
org.apache.lucene.index.IndexReader
org.apache.lucene.index.CompositeReader
org.apache.lucene.index.BaseCompositeReader<MultiPassIndexSplitter.FakeDeleteLeafIndexReader>
org.apache.lucene.misc.index.MultiPassIndexSplitter.FakeDeleteIndexReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Enclosing class:
- MultiPassIndexSplitter
private static final class MultiPassIndexSplitter.FakeDeleteIndexReader
extends BaseCompositeReader<MultiPassIndexSplitter.FakeDeleteLeafIndexReader>
This class emulates deletions on the underlying index.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.index.IndexReader
IndexReader.CacheHelper, IndexReader.CacheKey, IndexReader.ClosedListener
-
Field Summary
Fields inherited from class org.apache.lucene.index.BaseCompositeReader
subReadersSorter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteDocument
(int docID) protected void
doClose()
Implements close.Optional method: Return aIndexReader.CacheHelper
that can be used to cache based on the content of this reader.(package private) final List<? extends MultiPassIndexSplitter.FakeDeleteLeafIndexReader>
private static MultiPassIndexSplitter.FakeDeleteLeafIndexReader[]
initSubReaders
(IndexReader reader) void
Methods inherited from class org.apache.lucene.index.BaseCompositeReader
docFreq, document, getDocCount, getSequentialSubReaders, getSumDocFreq, getSumTotalTermFreq, getTermVectors, maxDoc, numDocs, readerBase, readerIndex, storedFields, termVectors, totalTermFreq
Methods inherited from class org.apache.lucene.index.CompositeReader
getContext, toString
Methods inherited from class org.apache.lucene.index.IndexReader
close, decRef, document, document, ensureOpen, equals, getRefCount, getTermVector, hasDeletions, hashCode, incRef, leaves, notifyReaderClosedListeners, numDeletedDocs, registerParentReader, tryIncRef
-
Constructor Details
-
FakeDeleteIndexReader
- Throws:
IOException
-
-
Method Details
-
initSubReaders
private static MultiPassIndexSplitter.FakeDeleteLeafIndexReader[] initSubReaders(IndexReader reader) throws IOException - Throws:
IOException
-
deleteDocument
public void deleteDocument(int docID) -
undeleteAll
public void undeleteAll() -
doClose
protected void doClose()Description copied from class:IndexReader
Implements close.- Specified by:
doClose
in classIndexReader
-
getReaderCacheHelper
Description copied from class:IndexReader
Optional method: Return aIndexReader.CacheHelper
that can be used to cache based on the content of this reader. Two readers that have different data or different sets of deleted documents will be considered different.A return value of
null
indicates that this reader is not suited for caching, which is typically the case for short-lived wrappers that alter the content of the wrapped reader.- Specified by:
getReaderCacheHelper
in classIndexReader
-
getSequentialSubReadersWrapper
final List<? extends MultiPassIndexSplitter.FakeDeleteLeafIndexReader> getSequentialSubReadersWrapper()
-