public override FieldsConsumer fieldsConsumer(SegmentWriteState state)
{
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final String fileName = index.IndexFileNames.SegmentFileName(state.segmentInfo.name, state.segmentSuffix, EXTENSION);
string fileName = IndexFileNames.SegmentFileName(state.segmentInfo.name, state.segmentSuffix, EXTENSION);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final store.IndexOutput out = state.directory.createOutput(fileName, state.context);
IndexOutput @out = state.directory.createOutput(fileName, state.context);
bool success = false;
try
{
CodecUtil.WriteHeader(@out, CODEC_NAME, VERSION_CURRENT);
success = true;
}
finally
{
if (!success)
{
IOUtils.CloseWhileHandlingException(@out);
}
}
return new FieldsConsumerAnonymousInnerClassHelper(this, @out);
}