public final class SoftDeletesDirectoryReaderWrapper extends FilterDirectoryReader
Modifier and Type | Class and Description |
---|---|
private static class |
SoftDeletesDirectoryReaderWrapper.DelegatingCacheHelper |
(package private) static class |
SoftDeletesDirectoryReaderWrapper.SoftDeletesFilterCodecReader |
(package private) static class |
SoftDeletesDirectoryReaderWrapper.SoftDeletesFilterLeafReader |
private static class |
SoftDeletesDirectoryReaderWrapper.SoftDeletesSubReaderWrapper |
FilterDirectoryReader.SubReaderWrapper
IndexReader.CacheHelper, IndexReader.CacheKey, IndexReader.ClosedListener
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
field |
private IndexReader.CacheHelper |
readerCacheHelper |
in
directory
Modifier | Constructor and Description |
---|---|
private |
SoftDeletesDirectoryReaderWrapper(DirectoryReader in,
SoftDeletesDirectoryReaderWrapper.SoftDeletesSubReaderWrapper wrapper) |
|
SoftDeletesDirectoryReaderWrapper(DirectoryReader in,
java.lang.String field)
Creates a new soft deletes wrapper.
|
Modifier and Type | Method and Description |
---|---|
private static boolean |
assertDocCounts(int expectedNumDocs,
int numSoftDeletes,
LeafReader reader) |
protected DirectoryReader |
doWrapDirectoryReader(DirectoryReader in)
Called by the doOpenIfChanged() methods to return a new wrapped DirectoryReader.
|
IndexReader.CacheHelper |
getReaderCacheHelper()
Optional method: Return a
IndexReader.CacheHelper that can be used to cache
based on the content of this reader. |
(package private) static LeafReader |
wrap(LeafReader reader,
java.lang.String field) |
doClose, doOpenIfChanged, doOpenIfChanged, doOpenIfChanged, getDelegate, getIndexCommit, getVersion, isCurrent, unwrap
directory, indexExists, listCommits, open, open, open, open, open, open, openIfChanged, openIfChanged, openIfChanged, openIfChanged
docFreq, document, getDocCount, getSequentialSubReaders, getSumDocFreq, getSumTotalTermFreq, getTermVectors, maxDoc, numDocs, readerBase, readerIndex, totalTermFreq
getContext, toString
close, decRef, document, document, ensureOpen, equals, getRefCount, getTermVector, hasDeletions, hashCode, incRef, leaves, notifyReaderClosedListeners, numDeletedDocs, registerParentReader, tryIncRef
private final java.lang.String field
private final IndexReader.CacheHelper readerCacheHelper
public SoftDeletesDirectoryReaderWrapper(DirectoryReader in, java.lang.String field) throws java.io.IOException
in
- the incoming directory readerfield
- the soft deletes fieldjava.io.IOException
private SoftDeletesDirectoryReaderWrapper(DirectoryReader in, SoftDeletesDirectoryReaderWrapper.SoftDeletesSubReaderWrapper wrapper) throws java.io.IOException
java.io.IOException
protected DirectoryReader doWrapDirectoryReader(DirectoryReader in) throws java.io.IOException
FilterDirectoryReader
doWrapDirectoryReader
in class FilterDirectoryReader
in
- the DirectoryReader to wrapjava.io.IOException
public IndexReader.CacheHelper getReaderCacheHelper()
IndexReader
IndexReader.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.
getReaderCacheHelper
in class IndexReader
static LeafReader wrap(LeafReader reader, java.lang.String field) throws java.io.IOException
java.io.IOException
private static boolean assertDocCounts(int expectedNumDocs, int numSoftDeletes, LeafReader reader)