Package org.apache.lucene.codecs
Class SegmentInfoFormat
- java.lang.Object
-
- org.apache.lucene.codecs.SegmentInfoFormat
-
- Direct Known Subclasses:
Lucene99SegmentInfoFormat
public abstract class SegmentInfoFormat extends Object
Expert: Controls the format of theSegmentInfo(segment metadata file).- See Also:
SegmentInfo- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSegmentInfoFormat()Sole constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract SegmentInforead(Directory directory, String segmentName, byte[] segmentID, IOContext context)ReadSegmentInfodata from a directory.abstract voidwrite(Directory dir, SegmentInfo info, IOContext ioContext)WriteSegmentInfodata.
-
-
-
Method Detail
-
read
public abstract SegmentInfo read(Directory directory, String segmentName, byte[] segmentID, IOContext context) throws IOException
ReadSegmentInfodata from a directory.- Parameters:
directory- directory to read fromsegmentName- name of the segment to readsegmentID- expected identifier for the segment- Returns:
- infos instance to be populated with data
- Throws:
IOException- If an I/O error occurs
-
write
public abstract void write(Directory dir, SegmentInfo info, IOContext ioContext) throws IOException
WriteSegmentInfodata. The codec must add its SegmentInfo filename(s) toinfobefore doing i/o.- Throws:
IOException- If an I/O error occurs
-
-