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.test.engine.ThrowingLeafReaderWrapper
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class ThrowingLeafReaderWrapper extends FilterLeafReader
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 Classes Modifier and Type Class Description static classThrowingLeafReaderWrapper.FlagsFlags passed toThrowingLeafReaderWrapper.Thrower.maybeThrow(org.elasticsearch.test.engine.ThrowingLeafReaderWrapper.Flags)when the corresponding method is called.static interfaceThrowingLeafReaderWrapper.ThrowerA callback interface that allows to throw certain exceptions for methods called on the IndexReader that is wrapped byThrowingLeafReaderWrapperstatic classThrowingLeafReaderWrapper.ThrowingFieldsWraps a Fields but with additional assertsstatic classThrowingLeafReaderWrapper.ThrowingTermsWraps a Terms but with additional asserts-
Nested classes/interfaces inherited from class org.apache.lucene.index.FilterLeafReader
FilterLeafReader.FilterFields, FilterLeafReader.FilterPostingsEnum, FilterLeafReader.FilterTerms, FilterLeafReader.FilterTermsEnum
-
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.FilterLeafReader
in
-
-
Constructor Summary
Constructors Constructor Description ThrowingLeafReaderWrapper(LeafReader in, ThrowingLeafReaderWrapper.Thrower thrower)
-
Method Summary
Modifier and Type Method Description BinaryDocValuesgetBinaryDocValues(java.lang.String field)IndexReader.CacheHelpergetCoreCacheHelper()NumericDocValuesgetNormValues(java.lang.String field)NumericDocValuesgetNumericDocValues(java.lang.String field)IndexReader.CacheHelpergetReaderCacheHelper()SortedDocValuesgetSortedDocValues(java.lang.String field)SortedSetDocValuesgetSortedSetDocValues(java.lang.String field)FieldsgetTermVectors(int docID)Termsterms(java.lang.String field)-
Methods inherited from class org.apache.lucene.index.FilterLeafReader
checkIntegrity, doClose, document, getDelegate, getFieldInfos, getLiveDocs, getMetaData, getPointValues, getSortedNumericDocValues, maxDoc, numDocs, 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, numDeletedDocs, registerParentReader, tryIncRef
-
-
-
-
Constructor Detail
-
ThrowingLeafReaderWrapper
public ThrowingLeafReaderWrapper(LeafReader in, ThrowingLeafReaderWrapper.Thrower thrower)
-
-
Method Detail
-
terms
public Terms terms(java.lang.String field) throws java.io.IOException
- Overrides:
termsin classFilterLeafReader- Throws:
java.io.IOException
-
getTermVectors
public Fields getTermVectors(int docID) throws java.io.IOException
- Overrides:
getTermVectorsin classFilterLeafReader- Throws:
java.io.IOException
-
getNumericDocValues
public NumericDocValues getNumericDocValues(java.lang.String field) throws java.io.IOException
- Overrides:
getNumericDocValuesin classFilterLeafReader- Throws:
java.io.IOException
-
getBinaryDocValues
public BinaryDocValues getBinaryDocValues(java.lang.String field) throws java.io.IOException
- Overrides:
getBinaryDocValuesin classFilterLeafReader- Throws:
java.io.IOException
-
getSortedDocValues
public SortedDocValues getSortedDocValues(java.lang.String field) throws java.io.IOException
- Overrides:
getSortedDocValuesin classFilterLeafReader- Throws:
java.io.IOException
-
getSortedSetDocValues
public SortedSetDocValues getSortedSetDocValues(java.lang.String field) throws java.io.IOException
- Overrides:
getSortedSetDocValuesin classFilterLeafReader- Throws:
java.io.IOException
-
getNormValues
public NumericDocValues getNormValues(java.lang.String field) throws java.io.IOException
- Overrides:
getNormValuesin classFilterLeafReader- Throws:
java.io.IOException
-
getCoreCacheHelper
public IndexReader.CacheHelper getCoreCacheHelper()
- Specified by:
getCoreCacheHelperin classLeafReader
-
getReaderCacheHelper
public IndexReader.CacheHelper getReaderCacheHelper()
- Specified by:
getReaderCacheHelperin classIndexReader
-
-