Package org.elasticsearch.test.engine
Class ThrowingLeafReaderWrapper
java.lang.Object
org.apache.lucene.index.IndexReader
org.apache.lucene.index.LeafReader
org.apache.lucene.index.FilterLeafReader
org.elasticsearch.common.lucene.index.SequentialStoredFieldsLeafReader
org.elasticsearch.test.engine.ThrowingLeafReaderWrapper
- All Implemented Interfaces:
Closeable,AutoCloseable
An FilterLeafReader that allows to throw exceptions if certain methods
are called on is. This allows to test parts of the system under certain
error conditions that would otherwise not be possible.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumFlags passed toThrowingLeafReaderWrapper.Thrower.maybeThrow(org.elasticsearch.test.engine.ThrowingLeafReaderWrapper.Flags)when the corresponding method is called.static interfaceA callback interface that allows to throw certain exceptions for methods called on the IndexReader that is wrapped byThrowingLeafReaderWrapperstatic classWraps a Fields but with additional assertsstatic classWraps a Terms but with additional assertsNested classes/interfaces inherited from class org.apache.lucene.index.FilterLeafReader
org.apache.lucene.index.FilterLeafReader.FilterFields, org.apache.lucene.index.FilterLeafReader.FilterPostingsEnum, org.apache.lucene.index.FilterLeafReader.FilterTerms, org.apache.lucene.index.FilterLeafReader.FilterTermsEnumNested classes/interfaces inherited from class org.apache.lucene.index.IndexReader
org.apache.lucene.index.IndexReader.CacheHelper, org.apache.lucene.index.IndexReader.CacheKey, org.apache.lucene.index.IndexReader.ClosedListener -
Field Summary
Fields inherited from class org.apache.lucene.index.FilterLeafReader
in -
Constructor Summary
ConstructorsConstructorDescriptionThrowingLeafReaderWrapper(org.apache.lucene.index.LeafReader in, ThrowingLeafReaderWrapper.Thrower thrower) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.lucene.codecs.StoredFieldsReaderdoGetSequentialStoredFieldsReader(org.apache.lucene.codecs.StoredFieldsReader reader) org.apache.lucene.index.BinaryDocValuesgetBinaryDocValues(String field) org.apache.lucene.index.IndexReader.CacheHelperorg.apache.lucene.index.NumericDocValuesgetNormValues(String field) org.apache.lucene.index.NumericDocValuesgetNumericDocValues(String field) org.apache.lucene.index.IndexReader.CacheHelperorg.apache.lucene.index.SortedDocValuesgetSortedDocValues(String field) org.apache.lucene.index.SortedSetDocValuesgetSortedSetDocValues(String field) org.apache.lucene.index.TermsMethods inherited from class org.elasticsearch.common.lucene.index.SequentialStoredFieldsLeafReader
getSequentialStoredFieldsReaderMethods inherited from class org.apache.lucene.index.FilterLeafReader
checkIntegrity, doClose, getByteVectorValues, getDelegate, getDocValuesSkipper, getFieldInfos, getFloatVectorValues, getLiveDocs, getMetaData, getPointValues, getSortedNumericDocValues, maxDoc, numDocs, searchNearestVectors, searchNearestVectors, storedFields, termVectors, toString, unwrapMethods inherited from class org.apache.lucene.index.LeafReader
docFreq, getContext, getDocCount, getSumDocFreq, getSumTotalTermFreq, postings, postings, searchNearestVectors, searchNearestVectors, totalTermFreqMethods inherited from class org.apache.lucene.index.IndexReader
close, decRef, ensureOpen, equals, getRefCount, hasDeletions, hashCode, incRef, leaves, notifyReaderClosedListeners, numDeletedDocs, registerParentReader, tryIncRef
-
Constructor Details
-
ThrowingLeafReaderWrapper
public ThrowingLeafReaderWrapper(org.apache.lucene.index.LeafReader in, ThrowingLeafReaderWrapper.Thrower thrower)
-
-
Method Details
-
terms
- Overrides:
termsin classorg.apache.lucene.index.FilterLeafReader- Throws:
IOException
-
getNumericDocValues
public org.apache.lucene.index.NumericDocValues getNumericDocValues(String field) throws IOException - Overrides:
getNumericDocValuesin classorg.apache.lucene.index.FilterLeafReader- Throws:
IOException
-
getBinaryDocValues
- Overrides:
getBinaryDocValuesin classorg.apache.lucene.index.FilterLeafReader- Throws:
IOException
-
getSortedDocValues
- Overrides:
getSortedDocValuesin classorg.apache.lucene.index.FilterLeafReader- Throws:
IOException
-
getSortedSetDocValues
public org.apache.lucene.index.SortedSetDocValues getSortedSetDocValues(String field) throws IOException - Overrides:
getSortedSetDocValuesin classorg.apache.lucene.index.FilterLeafReader- Throws:
IOException
-
getNormValues
- Overrides:
getNormValuesin classorg.apache.lucene.index.FilterLeafReader- Throws:
IOException
-
getCoreCacheHelper
public org.apache.lucene.index.IndexReader.CacheHelper getCoreCacheHelper()- Specified by:
getCoreCacheHelperin classorg.apache.lucene.index.LeafReader
-
getReaderCacheHelper
public org.apache.lucene.index.IndexReader.CacheHelper getReaderCacheHelper()- Specified by:
getReaderCacheHelperin classorg.apache.lucene.index.IndexReader
-
doGetSequentialStoredFieldsReader
protected org.apache.lucene.codecs.StoredFieldsReader doGetSequentialStoredFieldsReader(org.apache.lucene.codecs.StoredFieldsReader reader) - Specified by:
doGetSequentialStoredFieldsReaderin classSequentialStoredFieldsLeafReader
-