final class Lucene50CompoundReader extends Directory
| Modifier and Type | Class and Description |
|---|---|
static class |
Lucene50CompoundReader.FileEntry
Offset/Length for a slice inside of a compound file
|
| Modifier and Type | Field and Description |
|---|---|
private Directory |
directory |
private java.util.Map<java.lang.String,Lucene50CompoundReader.FileEntry> |
entries |
private IndexInput |
handle |
private java.lang.String |
segmentName |
private int |
version |
| Constructor and Description |
|---|
Lucene50CompoundReader(Directory directory,
SegmentInfo si,
IOContext context)
Create a new CompoundFileDirectory.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the store.
|
IndexOutput |
createOutput(java.lang.String name,
IOContext context)
Creates a new, empty file in the directory with the given name.
|
IndexOutput |
createTempOutput(java.lang.String prefix,
java.lang.String suffix,
IOContext context)
Creates a new, empty file for writing in the directory, with a
temporary file name including prefix and suffix, ending with the
reserved extension
.tmp. |
void |
deleteFile(java.lang.String name)
Not implemented
|
long |
fileLength(java.lang.String name)
Returns the length of a file in the directory.
|
java.lang.String[] |
listAll()
Returns an array of strings, one for each file in the directory.
|
Lock |
obtainLock(java.lang.String name)
Returns an obtained
Lock. |
IndexInput |
openInput(java.lang.String name,
IOContext context)
Returns a stream reading an existing file.
|
private java.util.Map<java.lang.String,Lucene50CompoundReader.FileEntry> |
readEntries(byte[] segmentID,
Directory dir,
java.lang.String entriesFileName)
Helper method that reads CFS entries from an input stream
|
void |
renameFile(java.lang.String from,
java.lang.String to)
Not implemented
|
void |
sync(java.util.Collection<java.lang.String> names)
Ensure that any writes to these files are moved to
stable storage.
|
java.lang.String |
toString() |
copyFrom, ensureOpen, openChecksumInputprivate final Directory directory
private final java.lang.String segmentName
private final java.util.Map<java.lang.String,Lucene50CompoundReader.FileEntry> entries
private final IndexInput handle
private int version
public Lucene50CompoundReader(Directory directory, SegmentInfo si, IOContext context) throws java.io.IOException
java.io.IOExceptionprivate final java.util.Map<java.lang.String,Lucene50CompoundReader.FileEntry> readEntries(byte[] segmentID, Directory dir, java.lang.String entriesFileName) throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
Directorypublic IndexInput openInput(java.lang.String name, IOContext context) throws java.io.IOException
DirectoryThrows FileNotFoundException or NoSuchFileException
if the file does not exist.
public java.lang.String[] listAll()
public void deleteFile(java.lang.String name)
deleteFile in class Directoryjava.lang.UnsupportedOperationException - always: not supported by CFSpublic void renameFile(java.lang.String from,
java.lang.String to)
renameFile in class Directoryjava.lang.UnsupportedOperationException - always: not supported by CFSpublic long fileLength(java.lang.String name)
throws java.io.IOException
fileLength in class Directoryname - the name of the file for which to return the length.java.io.IOException - if the file does not existpublic IndexOutput createOutput(java.lang.String name, IOContext context) throws java.io.IOException
DirectorycreateOutput in class Directoryjava.io.IOExceptionpublic IndexOutput createTempOutput(java.lang.String prefix, java.lang.String suffix, IOContext context) throws java.io.IOException
Directory.tmp. Use
IndexOutput.getName() to see what name was used.createTempOutput in class Directoryjava.io.IOExceptionpublic void sync(java.util.Collection<java.lang.String> names)
Directorypublic Lock obtainLock(java.lang.String name)
DirectoryLock.obtainLock in class Directoryname - the name of the lock file