Class LuceneOptimizedCompoundReader

java.lang.Object
org.apache.lucene.store.Directory
org.apache.lucene.codecs.CompoundDirectory
com.apple.foundationdb.record.lucene.codec.LuceneOptimizedCompoundReader
All Implemented Interfaces:
Closeable, AutoCloseable

public final class LuceneOptimizedCompoundReader extends org.apache.lucene.codecs.CompoundDirectory
Class for accessing a compound stream. This class implements a directory, but is limited to only read operations. Directory methods that would normally modify data throw an exception. Borrowed from Lucene to remove checksum from end of file. This implementation skips the reading and validation of checksum, which could have quite big data size sometimes.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LuceneOptimizedCompoundReader(org.apache.lucene.store.Directory directory, org.apache.lucene.index.SegmentInfo si, org.apache.lucene.store.IOContext context)
    Sole constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
     
    long
    Returns the length of a file in the directory.
    org.apache.lucene.store.Directory
    Get the underlying directory associated with this reader.
    Get the filename for storing the entries in this compound file.
     
    Returns an array of strings, one for each file in the directory.
    org.apache.lucene.store.IndexInput
    openInput(String name, org.apache.lucene.store.IOContext context)
     
     

    Methods inherited from class org.apache.lucene.codecs.CompoundDirectory

    createOutput, createTempOutput, deleteFile, obtainLock, rename, sync, syncMetaData

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

    copyFrom, ensureOpen, getTempFileName, openChecksumInput

    Methods inherited from class java.lang.Object

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

    • LuceneOptimizedCompoundReader

      public LuceneOptimizedCompoundReader(org.apache.lucene.store.Directory directory, org.apache.lucene.index.SegmentInfo si, org.apache.lucene.store.IOContext context) throws IOException
      Sole constructor.
      Parameters:
      directory - the underlying directory
      si - the segment
      context - context in which this is being read
      Throws:
      IOException - if there is an issue reading initial data
  • Method Details

    • 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.Directory
      Throws:
      IOException
    • openInput

      public org.apache.lucene.store.IndexInput openInput(String name, org.apache.lucene.store.IOContext context) throws IOException
      Specified by:
      openInput in class org.apache.lucene.store.Directory
      Throws:
      IOException
    • listAll

      public String[] listAll()
      Returns an array of strings, one for each file in the directory.
      Specified by:
      listAll in class org.apache.lucene.store.Directory
    • fileLength

      public long fileLength(String name) throws IOException
      Returns the length of a file in the directory.
      Specified by:
      fileLength in class org.apache.lucene.store.Directory
      Throws:
      IOException - if the file does not exist
    • toString

      public String toString()
      Overrides:
      toString in class org.apache.lucene.store.Directory
    • getPendingDeletions

      public Set<String> getPendingDeletions()
      Specified by:
      getPendingDeletions in class org.apache.lucene.store.Directory
    • checkIntegrity

      public void checkIntegrity() throws IOException
      Specified by:
      checkIntegrity in class org.apache.lucene.codecs.CompoundDirectory
      Throws:
      IOException
    • getDirectory

      public org.apache.lucene.store.Directory getDirectory()
      Get the underlying directory associated with this reader.
      Returns:
      the underlying directory
    • getEntriesFileName

      public String getEntriesFileName()
      Get the filename for storing the entries in this compound file.
      Returns:
      the filename for the entries