public VariableGapTermsIndexWriter(SegmentWriteState state, IndexTermSelector policy) throws IOException {final String indexFileName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, TERMS_INDEX_EXTENSION);out = state.directory.createOutput(indexFileName, state.context);boolean success = false;try {fieldInfos = state.fieldInfos;this.policy = policy;CodecUtil.writeIndexHeader(out, CODEC_NAME, VERSION_CURRENT, state.segmentInfo.getId(), state.segmentSuffix);success = true;} finally {if (!success) {IOUtils.closeWhileHandlingException(out);}}}
public VariableGapTermsIndexWriter(SegmentWriteState state, IndexTermSelector policy){string indexFileName = IndexFileNames.SegmentFileName(state.SegmentInfo.Name, state.SegmentSuffix, TERMS_INDEX_EXTENSION);m_output = state.Directory.CreateOutput(indexFileName, state.Context);bool success = false;try{fieldInfos = state.FieldInfos;this.policy = policy;WriteHeader(m_output);success = true;}finally{if (!success){IOUtils.DisposeWhileHandlingException(m_output);}}}