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

public class ThrowingLeafReaderWrapper extends SequentialStoredFieldsLeafReader
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 enum 
    static interface 
    A callback interface that allows to throw certain exceptions for methods called on the IndexReader that is wrapped by ThrowingLeafReaderWrapper
    static class 
    Wraps a Fields but with additional asserts
    static class 
    Wraps a Terms but with additional asserts

    Nested 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

    Constructors
    Constructor
    Description
    ThrowingLeafReaderWrapper(org.apache.lucene.index.LeafReader in, ThrowingLeafReaderWrapper.Thrower thrower)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.apache.lucene.codecs.StoredFieldsReader
    doGetSequentialStoredFieldsReader(org.apache.lucene.codecs.StoredFieldsReader reader)
     
    org.apache.lucene.index.BinaryDocValues
     
    org.apache.lucene.index.IndexReader.CacheHelper
     
    org.apache.lucene.index.NumericDocValues
     
    org.apache.lucene.index.NumericDocValues
     
    org.apache.lucene.index.IndexReader.CacheHelper
     
    org.apache.lucene.index.SortedDocValues
     
    org.apache.lucene.index.SortedSetDocValues
     
    org.apache.lucene.index.Fields
    getTermVectors(int docID)
     
    org.apache.lucene.index.Terms
    terms(String field)
     

    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

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • terms

      public org.apache.lucene.index.Terms terms(String field) throws IOException
      Overrides:
      terms in class org.apache.lucene.index.FilterLeafReader
      Throws:
      IOException
    • getTermVectors

      public org.apache.lucene.index.Fields getTermVectors(int docID) throws IOException
      Overrides:
      getTermVectors in class org.apache.lucene.index.FilterLeafReader
      Throws:
      IOException
    • getNumericDocValues

      public org.apache.lucene.index.NumericDocValues getNumericDocValues(String field) throws IOException
      Overrides:
      getNumericDocValues in class org.apache.lucene.index.FilterLeafReader
      Throws:
      IOException
    • getBinaryDocValues

      public org.apache.lucene.index.BinaryDocValues getBinaryDocValues(String field) throws IOException
      Overrides:
      getBinaryDocValues in class org.apache.lucene.index.FilterLeafReader
      Throws:
      IOException
    • getSortedDocValues

      public org.apache.lucene.index.SortedDocValues getSortedDocValues(String field) throws IOException
      Overrides:
      getSortedDocValues in class org.apache.lucene.index.FilterLeafReader
      Throws:
      IOException
    • getSortedSetDocValues

      public org.apache.lucene.index.SortedSetDocValues getSortedSetDocValues(String field) throws IOException
      Overrides:
      getSortedSetDocValues in class org.apache.lucene.index.FilterLeafReader
      Throws:
      IOException
    • getNormValues

      public org.apache.lucene.index.NumericDocValues getNormValues(String field) throws IOException
      Overrides:
      getNormValues in class org.apache.lucene.index.FilterLeafReader
      Throws:
      IOException
    • getCoreCacheHelper

      public org.apache.lucene.index.IndexReader.CacheHelper getCoreCacheHelper()
      Specified by:
      getCoreCacheHelper in class org.apache.lucene.index.LeafReader
    • getReaderCacheHelper

      public org.apache.lucene.index.IndexReader.CacheHelper getReaderCacheHelper()
      Specified by:
      getReaderCacheHelper in class org.apache.lucene.index.IndexReader
    • doGetSequentialStoredFieldsReader

      protected org.apache.lucene.codecs.StoredFieldsReader doGetSequentialStoredFieldsReader(org.apache.lucene.codecs.StoredFieldsReader reader)
      Specified by:
      doGetSequentialStoredFieldsReader in class SequentialStoredFieldsLeafReader