Package org.apache.lucene.codecs
Class CompoundDirectory
- java.lang.Object
-
- org.apache.lucene.store.Directory
-
- org.apache.lucene.codecs.CompoundDirectory
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
Lucene50CompoundReader
public abstract class CompoundDirectory extends Directory
A read-onlyDirectorythat consists of a view over a compound file.- See Also:
CompoundFormat
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCompoundDirectory()Sole constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidcheckIntegrity()Checks consistency of this directory.IndexOutputcreateOutput(java.lang.String name, IOContext context)Creates a new, empty file in the directory and returns anIndexOutputinstance for appending data to this file.IndexOutputcreateTempOutput(java.lang.String prefix, java.lang.String suffix, IOContext context)Creates a new, empty, temporary file in the directory and returns anIndexOutputinstance for appending data to this file.voiddeleteFile(java.lang.String name)Not implementedLockobtainLock(java.lang.String name)Acquires and returns aLockfor a file with the given name.voidrename(java.lang.String from, java.lang.String to)Not implementedvoidsync(java.util.Collection<java.lang.String> names)Ensures that any writes to these files are moved to stable storage (made durable).voidsyncMetaData()Ensures that directory metadata, such as recent file renames, are moved to stable storage.-
Methods inherited from class org.apache.lucene.store.Directory
close, copyFrom, ensureOpen, fileLength, getPendingDeletions, getTempFileName, listAll, openChecksumInput, openInput, toString
-
-
-
-
Method Detail
-
checkIntegrity
public abstract void checkIntegrity() throws java.io.IOExceptionChecks consistency of this directory.Note that this may be costly in terms of I/O, e.g. may involve computing a checksum value against large data files.
- Throws:
java.io.IOException
-
deleteFile
public final void deleteFile(java.lang.String name)
Not implemented- Specified by:
deleteFilein classDirectory- Parameters:
name- the name of an existing file.- Throws:
java.lang.UnsupportedOperationException- always: not supported by CFS
-
rename
public final void rename(java.lang.String from, java.lang.String to)Not implemented
-
syncMetaData
public final void syncMetaData()
Description copied from class:DirectoryEnsures that directory metadata, such as recent file renames, are moved to stable storage.- Specified by:
syncMetaDatain classDirectory- See Also:
Directory.sync(Collection)
-
createOutput
public final IndexOutput createOutput(java.lang.String name, IOContext context) throws java.io.IOException
Description copied from class:DirectoryCreates a new, empty file in the directory and returns anIndexOutputinstance for appending data to this file. This method must throwFileAlreadyExistsExceptionif the file already exists.- Specified by:
createOutputin classDirectory- Parameters:
name- the name of the file to create.- Throws:
java.io.IOException- in case of I/O error
-
createTempOutput
public final IndexOutput createTempOutput(java.lang.String prefix, java.lang.String suffix, IOContext context) throws java.io.IOException
Description copied from class:DirectoryCreates a new, empty, temporary file in the directory and returns anIndexOutputinstance for appending data to this file. The temporary file name (accessible viaIndexOutput.getName()) will start withprefix, end withsuffixand have a reserved file extension.tmp.- Specified by:
createTempOutputin classDirectory- Throws:
java.io.IOException
-
sync
public final void sync(java.util.Collection<java.lang.String> names)
Description copied from class:DirectoryEnsures that any writes to these files are moved to stable storage (made durable). Lucene uses this to properly commit changes to the index, to prevent a machine/OS crash from corrupting the index.- Specified by:
syncin classDirectory- See Also:
Directory.syncMetaData()
-
obtainLock
public final Lock obtainLock(java.lang.String name)
Description copied from class:DirectoryAcquires and returns aLockfor a file with the given name.- Specified by:
obtainLockin classDirectory- Parameters:
name- the name of the lock file
-
-