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
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
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.lucene.codecs.StoredFieldsReader
doGetSequentialStoredFieldsReader
(org.apache.lucene.codecs.StoredFieldsReader reader) getBinaryDocValues
(String field) getNormValues
(String field) getNumericDocValues
(String field) getSortedDocValues
(String field) getSortedSetDocValues
(String field) getTermVectors
(int docID) Methods inherited from class org.elasticsearch.common.lucene.index.SequentialStoredFieldsLeafReader
getSequentialStoredFieldsReader
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 Details
-
ThrowingLeafReaderWrapper
-
-
Method Details
-
terms
- Overrides:
terms
in classFilterLeafReader
- Throws:
IOException
-
getTermVectors
- Overrides:
getTermVectors
in classFilterLeafReader
- Throws:
IOException
-
getNumericDocValues
- Overrides:
getNumericDocValues
in classFilterLeafReader
- Throws:
IOException
-
getBinaryDocValues
- Overrides:
getBinaryDocValues
in classFilterLeafReader
- Throws:
IOException
-
getSortedDocValues
- Overrides:
getSortedDocValues
in classFilterLeafReader
- Throws:
IOException
-
getSortedSetDocValues
- Overrides:
getSortedSetDocValues
in classFilterLeafReader
- Throws:
IOException
-
getNormValues
- Overrides:
getNormValues
in classFilterLeafReader
- Throws:
IOException
-
getCoreCacheHelper
- Specified by:
getCoreCacheHelper
in classLeafReader
-
getReaderCacheHelper
- Specified by:
getReaderCacheHelper
in classIndexReader
-
doGetSequentialStoredFieldsReader
protected org.apache.lucene.codecs.StoredFieldsReader doGetSequentialStoredFieldsReader(org.apache.lucene.codecs.StoredFieldsReader reader) - Specified by:
doGetSequentialStoredFieldsReader
in classSequentialStoredFieldsLeafReader
-