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
ConstructorsConstructorDescriptionLuceneOptimizedCompoundReader(org.apache.lucene.store.Directory directory, org.apache.lucene.index.SegmentInfo si, org.apache.lucene.store.IOContext context) Sole constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()longfileLength(String name) Returns the length of a file in the directory.org.apache.lucene.store.DirectoryGet the underlying directory associated with this reader.Get the filename for storing the entries in this compound file.String[]listAll()Returns an array of strings, one for each file in the directory.org.apache.lucene.store.IndexInputtoString()Methods inherited from class org.apache.lucene.codecs.CompoundDirectory
createOutput, createTempOutput, deleteFile, obtainLock, rename, sync, syncMetaDataMethods inherited from class org.apache.lucene.store.Directory
copyFrom, ensureOpen, getTempFileName, openChecksumInput
-
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 directorysi- the segmentcontext- context in which this is being read- Throws:
IOException- if there is an issue reading initial data
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classorg.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:
openInputin classorg.apache.lucene.store.Directory- Throws:
IOException
-
listAll
Returns an array of strings, one for each file in the directory.- Specified by:
listAllin classorg.apache.lucene.store.Directory
-
fileLength
Returns the length of a file in the directory.- Specified by:
fileLengthin classorg.apache.lucene.store.Directory- Throws:
IOException- if the file does not exist
-
toString
- Overrides:
toStringin classorg.apache.lucene.store.Directory
-
getPendingDeletions
- Specified by:
getPendingDeletionsin classorg.apache.lucene.store.Directory
-
checkIntegrity
- Specified by:
checkIntegrityin classorg.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
Get the filename for storing the entries in this compound file.- Returns:
- the filename for the entries
-