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
Modifier and TypeClassDescriptionstatic enum
Flags passed toThrowingLeafReaderWrapper.Thrower.maybeThrow(org.elasticsearch.test.engine.ThrowingLeafReaderWrapper.Flags)
when the corresponding method is called.static interface
A callback interface that allows to throw certain exceptions for methods called on the IndexReader that is wrapped byThrowingLeafReaderWrapper
static class
Wraps a Fields but with additional assertsstatic class
Wraps 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.FilterTermsEnum
Nested 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
ConstructorDescriptionThrowingLeafReaderWrapper
(org.apache.lucene.index.LeafReader in, ThrowingLeafReaderWrapper.Thrower thrower) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.lucene.codecs.StoredFieldsReader
doGetSequentialStoredFieldsReader
(org.apache.lucene.codecs.StoredFieldsReader reader) org.apache.lucene.index.BinaryDocValues
getBinaryDocValues
(String field) org.apache.lucene.index.IndexReader.CacheHelper
org.apache.lucene.index.NumericDocValues
getNormValues
(String field) org.apache.lucene.index.NumericDocValues
getNumericDocValues
(String field) org.apache.lucene.index.IndexReader.CacheHelper
org.apache.lucene.index.SortedDocValues
getSortedDocValues
(String field) org.apache.lucene.index.SortedSetDocValues
getSortedSetDocValues
(String field) org.apache.lucene.index.Fields
getTermVectors
(int docID) org.apache.lucene.index.Terms
Methods inherited from class org.elasticsearch.common.lucene.index.SequentialStoredFieldsLeafReader
getSequentialStoredFieldsReader
Methods inherited from class org.apache.lucene.index.FilterLeafReader
checkIntegrity, doClose, document, getByteVectorValues, getDelegate, getFieldInfos, getFloatVectorValues, getLiveDocs, getMetaData, getPointValues, getSortedNumericDocValues, maxDoc, numDocs, searchNearestVectors, searchNearestVectors, storedFields, termVectors, toString, unwrap
Methods inherited from class org.apache.lucene.index.LeafReader
docFreq, getContext, getDocCount, getSumDocFreq, getSumTotalTermFreq, postings, postings, totalTermFreq
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
-
ThrowingLeafReaderWrapper
public ThrowingLeafReaderWrapper(org.apache.lucene.index.LeafReader in, ThrowingLeafReaderWrapper.Thrower thrower)
-
-
Method Details
-
terms
- Overrides:
terms
in classorg.apache.lucene.index.FilterLeafReader
- Throws:
IOException
-
getTermVectors
- Overrides:
getTermVectors
in classorg.apache.lucene.index.FilterLeafReader
- Throws:
IOException
-
getNumericDocValues
public org.apache.lucene.index.NumericDocValues getNumericDocValues(String field) throws IOException - Overrides:
getNumericDocValues
in classorg.apache.lucene.index.FilterLeafReader
- Throws:
IOException
-
getBinaryDocValues
- Overrides:
getBinaryDocValues
in classorg.apache.lucene.index.FilterLeafReader
- Throws:
IOException
-
getSortedDocValues
- Overrides:
getSortedDocValues
in classorg.apache.lucene.index.FilterLeafReader
- Throws:
IOException
-
getSortedSetDocValues
public org.apache.lucene.index.SortedSetDocValues getSortedSetDocValues(String field) throws IOException - Overrides:
getSortedSetDocValues
in classorg.apache.lucene.index.FilterLeafReader
- Throws:
IOException
-
getNormValues
- Overrides:
getNormValues
in classorg.apache.lucene.index.FilterLeafReader
- Throws:
IOException
-
getCoreCacheHelper
public org.apache.lucene.index.IndexReader.CacheHelper getCoreCacheHelper()- Specified by:
getCoreCacheHelper
in classorg.apache.lucene.index.LeafReader
-
getReaderCacheHelper
public org.apache.lucene.index.IndexReader.CacheHelper getReaderCacheHelper()- Specified by:
getReaderCacheHelper
in classorg.apache.lucene.index.IndexReader
-
doGetSequentialStoredFieldsReader
protected org.apache.lucene.codecs.StoredFieldsReader doGetSequentialStoredFieldsReader(org.apache.lucene.codecs.StoredFieldsReader reader) - Specified by:
doGetSequentialStoredFieldsReader
in classSequentialStoredFieldsLeafReader
-