public FSTTermsWriter(SegmentWriteState state, PostingsWriterBase postingsWriter)
{
var termsFileName = IndexFileNames.SegmentFileName(state.SegmentInfo.Name, state.SegmentSuffix,
TERMS_EXTENSION);
_postingsWriter = postingsWriter;
_fieldInfos = state.FieldInfos;
_output = state.Directory.CreateOutput(termsFileName, state.Context);
var success = false;
try
{
WriteHeader(_output);
_postingsWriter.Init(_output);
success = true;
}
finally
{
if (!success)
{
IOUtils.CloseWhileHandlingException(_output);
}
}
}