Class Store.VerifyingIndexInput

java.lang.Object
org.apache.lucene.store.DataInput
org.apache.lucene.store.IndexInput
org.apache.lucene.store.ChecksumIndexInput
org.elasticsearch.index.store.Store.VerifyingIndexInput
All Implemented Interfaces:
Closeable, AutoCloseable, Cloneable
Enclosing class:
Store

public static class Store.VerifyingIndexInput extends org.apache.lucene.store.ChecksumIndexInput
Index input that calculates checksum as data is read from the input.

This class supports random access (it is possible to seek backward and forward) in order to accommodate retry mechanism that is used in some repository plugins (S3 for example). However, the checksum is only calculated on the first read. All consecutive reads of the same data are not used to calculate the checksum.

  • Constructor Summary

    Constructors
    Constructor
    Description
    VerifyingIndexInput(org.apache.lucene.store.IndexInput input)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.lucene.store.IndexInput
     
    void
     
    long
     
    long
     
    long
     
    long
     
    byte
     
    void
    readBytes(byte[] b, int offset, int len)
     
    void
    seek(long pos)
     
    org.apache.lucene.store.IndexInput
    slice(String sliceDescription, long offset, long length)
     
    long
     

    Methods inherited from class org.apache.lucene.store.IndexInput

    getFullSliceDescription, isLoaded, prefetch, randomAccessSlice, skipBytes, slice, toString, updateReadAdvice

    Methods inherited from class org.apache.lucene.store.DataInput

    readBytes, readFloats, readGroupVInt, readInt, readInts, readLong, readLongs, readMapOfStrings, readSetOfStrings, readShort, readString, readVInt, readVLong, readZInt, readZLong

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • VerifyingIndexInput

      public VerifyingIndexInput(org.apache.lucene.store.IndexInput input)
  • Method Details

    • readByte

      public byte readByte() throws IOException
      Specified by:
      readByte in class org.apache.lucene.store.DataInput
      Throws:
      IOException
    • readBytes

      public void readBytes(byte[] b, int offset, int len) throws IOException
      Specified by:
      readBytes in class org.apache.lucene.store.DataInput
      Throws:
      IOException
    • getChecksum

      public long getChecksum()
      Specified by:
      getChecksum in class org.apache.lucene.store.ChecksumIndexInput
    • seek

      public void seek(long pos) throws IOException
      Overrides:
      seek in class org.apache.lucene.store.ChecksumIndexInput
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in class org.apache.lucene.store.IndexInput
      Throws:
      IOException
    • getFilePointer

      public long getFilePointer()
      Specified by:
      getFilePointer in class org.apache.lucene.store.IndexInput
    • length

      public long length()
      Specified by:
      length in class org.apache.lucene.store.IndexInput
    • clone

      public org.apache.lucene.store.IndexInput clone()
      Overrides:
      clone in class org.apache.lucene.store.IndexInput
    • slice

      public org.apache.lucene.store.IndexInput slice(String sliceDescription, long offset, long length) throws IOException
      Specified by:
      slice in class org.apache.lucene.store.IndexInput
      Throws:
      IOException
    • getStoredChecksum

      public long getStoredChecksum()
    • verify

      public long verify() throws org.apache.lucene.index.CorruptIndexException
      Throws:
      org.apache.lucene.index.CorruptIndexException