LUCENE-2946: doc 4.0 compound file format

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1332632 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-05-01 12:48:31 +00:00
parent 0f3293ed12
commit 841c9346ef
1 changed files with 29 additions and 0 deletions

View File

@ -17,8 +17,11 @@ package org.apache.lucene.store;
* limitations under the License. * limitations under the License.
*/ */
import org.apache.lucene.codecs.Codec; // javadocs
import org.apache.lucene.codecs.LiveDocsFormat; // javadocs
import org.apache.lucene.index.CorruptIndexException; import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.IndexFileNames;
import org.apache.lucene.store.DataOutput; // javadocs
import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.IOUtils;
import java.util.Collection; import java.util.Collection;
@ -32,6 +35,32 @@ import java.io.IOException;
* Class for accessing a compound stream. * Class for accessing a compound stream.
* This class implements a directory, but is limited to only read operations. * This class implements a directory, but is limited to only read operations.
* Directory methods that would normally modify data throw an exception. * Directory methods that would normally modify data throw an exception.
* <p>
* All files belonging to a segment have the same name with varying extensions.
* The extensions correspond to the different file formats used by the {@link Codec}.
* When using the Compound File format these files are collapsed into a
* single <tt>.cfs</tt> file (except for the {@link LiveDocsFormat}, with a
* corresponding <tt>.cfe</tt> file indexing its sub-files.
* <p>
* Files:
* <ul>
* <li><tt>.cfs</tt>: An optional "virtual" file consisting of all the other
* index files for systems that frequently run out of file handles.
* <li><tt>.cfe</tt>: The "virtual" compound file's entry table holding all
* entries in the corresponding .cfs file.
* </ul>
* <p>Description:</p>
* <ul>
* <li>Compound (.cfs) --&gt; FileData <sup>FileCount</sup></li>
* <li>Compound Entry Table (.cfe) --&gt; Version, FileCount, &lt;FileName,
* DataOffset, DataLength&gt; <sup>FileCount</sup></li>
* <li>Version --&gt; {@link DataOutput#writeInt Int32}</li>
* <li>FileCount --&gt; {@link DataOutput#writeVInt VInt}</li>
* <li>DataOffset,DataLength --&gt; {@link DataOutput#writeLong UInt64}</li>
* <li>FileName --&gt; {@link DataOutput#writeString String}</li>
* <li>FileData --&gt; raw file data</li>
* </ul>
*
* @lucene.experimental * @lucene.experimental
*/ */
public final class CompoundFileDirectory extends Directory { public final class CompoundFileDirectory extends Directory {