Package org.apache.lucene.codecs
Class SegmentInfoFormat
java.lang.Object
org.apache.lucene.codecs.SegmentInfoFormat
- Direct Known Subclasses:
Lucene90SegmentInfoFormat
Expert: Controls the format of the
SegmentInfo
(segment metadata file).- See Also:
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract SegmentInfo
ReadSegmentInfo
data from a directory.abstract void
write
(Directory dir, SegmentInfo info, IOContext ioContext) WriteSegmentInfo
data.
-
Constructor Details
-
SegmentInfoFormat
protected SegmentInfoFormat()Sole constructor. (For invocation by subclass constructors, typically implicit.)
-
-
Method Details
-
read
public abstract SegmentInfo read(Directory directory, String segmentName, byte[] segmentID, IOContext context) throws IOException ReadSegmentInfo
data 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
WriteSegmentInfo
data. The codec must add its SegmentInfo filename(s) toinfo
before doing i/o.- Throws:
IOException
- If an I/O error occurs
-