Apache Lucene open-source search software
LUCENE-2946: doc 4.0 compound file format
Robert Muir841c9346efdd
diff --git a/lucene/core/src/java/org/apache/lucene/store/CompoundFileDirectory.java b/lucene/core/src/java/org/apache/lucene/store/CompoundFileDirectory.javaindex 260c2fa38bc..f48ebadd2e0 100644--- a/lucene/core/src/java/org/apache/lucene/store/CompoundFileDirectory.java+++ b/lucene/core/src/java/org/apache/lucene/store/CompoundFileDirectory.java@@ -17,8 +17,11 @@ package org.apache.lucene.store;* limitations under the License.*/+import org.apache.lucene.codecs.Codec; // javadocs+import org.apache.lucene.codecs.LiveDocsFormat; // javadocsimport org.apache.lucene.index.CorruptIndexException;import org.apache.lucene.index.IndexFileNames;+import org.apache.lucene.store.DataOutput; // javadocsimport org.apache.lucene.util.IOUtils;import java.util.Collection;@@ -32,6 +35,32 @@ import java.io.IOException;* 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.+ * <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) --> FileData <sup>FileCount</sup></li>+ * <li>Compound Entry Table (.cfe) --> Version, FileCount, <FileName,+ * DataOffset, DataLength> <sup>FileCount</sup></li>+ * <li>Version --> {@link DataOutput#writeInt Int32}</li>+ * <li>FileCount --> {@link DataOutput#writeVInt VInt}</li>+ * <li>DataOffset,DataLength --> {@link DataOutput#writeLong UInt64}</li>+ * <li>FileName --> {@link DataOutput#writeString String}</li>+ * <li>FileData --> raw file data</li>+ * </ul>+ ** @lucene.experimental*/public final class CompoundFileDirectory extends Directory {