Class IndexInputReader

java.lang.Object
org.apache.lucene.store.DataInput
org.apache.lucene.store.IndexInput
org.apache.cassandra.index.sai.disk.io.IndexInputReader
All Implemented Interfaces:
Closeable, AutoCloseable, Cloneable

public class IndexInputReader extends org.apache.lucene.store.IndexInput
This is a wrapper over a Cassandra RandomAccessReader that provides an IndexInput interface for Lucene classes that need IndexInput. This is an optimisation because the Lucene DataInput reads bytes one at a time whereas the RandomAccessReader is optimised to read multibyte objects faster.
  • Method Details

    • create

      public static IndexInputReader create(RandomAccessReader input)
    • create

      public static IndexInputReader create(RandomAccessReader input, Runnable doOnClose)
    • create

      public static IndexInputReader create(FileHandle handle)
    • readByte

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

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

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

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

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

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

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