|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.lucene.store.Directory
org.apache.lucene.store.BaseDirectory
org.apache.lucene.store.CompoundFileDirectory
public final class CompoundFileDirectory
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.
All files belonging to a segment have the same name with varying extensions.
The extensions correspond to the different file formats used by the Codec.
When using the Compound File format these files are collapsed into a
single .cfs file (except for the LiveDocsFormat, with a
corresponding .cfe file indexing its sub-files.
Files:
Description:
CodecHeaderVIntUInt64StringNotes:
| Nested Class Summary | |
|---|---|
static class |
CompoundFileDirectory.FileEntry
Offset/Length for a slice inside of a compound file |
| Nested classes/interfaces inherited from class org.apache.lucene.store.Directory |
|---|
Directory.IndexInputSlicer |
| Field Summary | |
|---|---|
protected int |
readBufferSize
|
| Fields inherited from class org.apache.lucene.store.BaseDirectory |
|---|
isOpen, lockFactory |
| Constructor Summary | |
|---|---|
CompoundFileDirectory(Directory directory,
String fileName,
IOContext context,
boolean openForWrite)
Create a new CompoundFileDirectory. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the store. |
IndexOutput |
createOutput(String name,
IOContext context)
Creates a new, empty file in the directory with the given name. |
Directory.IndexInputSlicer |
createSlicer(String name,
IOContext context)
Creates an Directory.IndexInputSlicer for the given file name. |
void |
deleteFile(String name)
Not implemented |
boolean |
fileExists(String name)
Returns true iff a file with the given name exists. |
long |
fileLength(String name)
Returns the length of a file in the directory. |
Directory |
getDirectory()
|
String |
getName()
|
String[] |
listAll()
Returns an array of strings, one for each file in the directory. |
Lock |
makeLock(String name)
Not implemented |
IndexInput |
openInput(String name,
IOContext context)
Returns a stream reading an existing file, with the specified read buffer size. |
void |
renameFile(String from,
String to)
Not implemented |
void |
sync(Collection<String> names)
Ensure that any writes to these files are moved to stable storage. |
String |
toString()
|
| Methods inherited from class org.apache.lucene.store.BaseDirectory |
|---|
clearLock, ensureOpen, getLockFactory, setLockFactory |
| Methods inherited from class org.apache.lucene.store.Directory |
|---|
copy, getLockID |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final int readBufferSize
| Constructor Detail |
|---|
public CompoundFileDirectory(Directory directory,
String fileName,
IOContext context,
boolean openForWrite)
throws IOException
IOException| Method Detail |
|---|
public Directory getDirectory()
public String getName()
public void close()
throws IOException
Directory
close in interface Closeableclose in class DirectoryIOException
public IndexInput openInput(String name,
IOContext context)
throws IOException
DirectoryFSDirectory and CompoundFileDirectory.
FileNotFoundException if the file does not exist
(not java.nio.file.NoSuchFileException of Java 7).
IOExceptionpublic String[] listAll()
listAll in class Directorypublic boolean fileExists(String name)
fileExists in class Directorypublic void deleteFile(String name)
deleteFile in class DirectoryUnsupportedOperationException - always: not supported by CFS
public void renameFile(String from,
String to)
UnsupportedOperationException - always: not supported by CFS
public long fileLength(String name)
throws IOException
fileLength in class Directoryname - the name of the file for which to return the length.
IOException - if the file does not exist
public IndexOutput createOutput(String name,
IOContext context)
throws IOException
Directory
createOutput in class DirectoryIOExceptionpublic void sync(Collection<String> names)
Directory
sync in class Directorypublic Lock makeLock(String name)
makeLock in class BaseDirectoryname - the name of the lock file
UnsupportedOperationException - always: not supported by CFS
public Directory.IndexInputSlicer createSlicer(String name,
IOContext context)
throws IOException
DirectoryDirectory.IndexInputSlicer for the given file name.
IndexInputSlicer allows other Directory implementations to
efficiently open one or more sliced IndexInput instances from a
single file handle. The underlying file handle is kept open until the
Directory.IndexInputSlicer is closed.
FileNotFoundException if the file does not exist
(not java.nio.file.NoSuchFileException of Java 7).
createSlicer in class DirectoryIOException - if an IOException occurspublic String toString()
toString in class Directory
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||