public override FieldsConsumer FieldsConsumer(SegmentWriteState state) { if (!_oldFormatImpersonationIsActive) { return base.FieldsConsumer(state); } else { PostingsWriterBase docs = new Lucene40PostingsWriter(state); // TODO: should we make the terms index more easily // pluggable? Ie so that this codec would record which // index impl was used, and switch on loading? // Or... you must make a new Codec for this? bool success = false; try { FieldsConsumer ret = new BlockTreeTermsWriter(state, docs, MinBlockSize, MaxBlockSize); success = true; return ret; } finally { if (!success) { docs.Dispose(); } } } }
public override FieldsConsumer FieldsConsumer(SegmentWriteState state) { if (!LuceneTestCase.OLD_FORMAT_IMPERSONATION_IS_ACTIVE) { return(base.FieldsConsumer(state)); } else { PostingsWriterBase docs = new Lucene40PostingsWriter(state); // TODO: should we make the terms index more easily // pluggable? Ie so that this codec would record which // index impl was used, and switch on loading? // Or... you must make a new Codec for this? bool success = false; try { FieldsConsumer ret = new BlockTreeTermsWriter(state, docs, MinBlockSize, MaxBlockSize); success = true; return(ret); } finally { if (!success) { docs.Dispose(); } } } }
public override DocValuesConsumer FieldsConsumer(SegmentWriteState state) { if (!LuceneTestCase.OLD_FORMAT_IMPERSONATION_IS_ACTIVE) { return base.FieldsConsumer(state); } else { string filename = IndexFileNames.SegmentFileName(state.SegmentInfo.Name, "dv", IndexFileNames.COMPOUND_FILE_EXTENSION); return new Lucene40DocValuesWriter(state, filename, Lucene40FieldInfosReader.LEGACY_DV_TYPE_KEY); } }
public override DocValuesConsumer FieldsConsumer(SegmentWriteState state) { if (!LuceneTestCase.OLD_FORMAT_IMPERSONATION_IS_ACTIVE) { return(base.FieldsConsumer(state)); } else { string filename = IndexFileNames.SegmentFileName(state.SegmentInfo.Name, "dv", IndexFileNames.COMPOUND_FILE_EXTENSION); return(new Lucene40DocValuesWriter(state, filename, Lucene40FieldInfosReader.LEGACY_DV_TYPE_KEY)); } }
public override DocValuesConsumer NormsConsumer(SegmentWriteState state) { if (!_oldFormatImpersonationIsActive) { return(base.NormsConsumer(state)); } else { string filename = IndexFileNames.SegmentFileName(state.SegmentInfo.Name, "nrm", IndexFileNames.COMPOUND_FILE_EXTENSION); return(new Lucene40DocValuesWriter(state, filename, Lucene40FieldInfosReader.LEGACY_NORM_TYPE_KEY)); } }
public override DocValuesConsumer FieldsConsumer(SegmentWriteState state) { if (!_oldFormatImpersonationIsActive) { return base.FieldsConsumer(state); } else { string filename = IndexFileNames.SegmentFileName(state.SegmentInfo.Name, "dv", IndexFileNames.COMPOUND_FILE_EXTENSION); return new Lucene40DocValuesWriter(state, filename, Lucene40FieldInfosReader.LEGACY_DV_TYPE_KEY); } }
public override DocValuesConsumer FieldsConsumer(SegmentWriteState state) { if (!_oldFormatImpersonationIsActive) { return base.FieldsConsumer(state); } else { // note: we choose DEFAULT here (its reasonably fast, and for small bpv has tiny waste) return new Lucene42DocValuesConsumer(state, DATA_CODEC, DATA_EXTENSION, METADATA_CODEC, METADATA_EXTENSION, AcceptableOverheadRatio); } }
public override DocValuesConsumer FieldsConsumer(SegmentWriteState state) { if (!LuceneTestCase.OLD_FORMAT_IMPERSONATION_IS_ACTIVE) { return(base.FieldsConsumer(state)); } else { // note: we choose DEFAULT here (its reasonably fast, and for small bpv has tiny waste) return(new Lucene42DocValuesConsumer(state, DATA_CODEC, DATA_EXTENSION, METADATA_CODEC, METADATA_EXTENSION, m_acceptableOverheadRatio)); } }
public override DocValuesConsumer FieldsConsumer(SegmentWriteState state) { if (!_oldFormatImpersonationIsActive) { return(base.FieldsConsumer(state)); } else { // note: we choose DEFAULT here (its reasonably fast, and for small bpv has tiny waste) return(new Lucene42DocValuesConsumer(state, DATA_CODEC, DATA_EXTENSION, METADATA_CODEC, METADATA_EXTENSION, AcceptableOverheadRatio)); } }
public override DocValuesConsumer FieldsConsumer(SegmentWriteState state) { if (!LuceneTestCase.OLD_FORMAT_IMPERSONATION_IS_ACTIVE) { return base.FieldsConsumer(state); } else { // note: we choose DEFAULT here (its reasonably fast, and for small bpv has tiny waste) return new Lucene42DocValuesConsumer(state, DATA_CODEC, DATA_EXTENSION, METADATA_CODEC, METADATA_EXTENSION, AcceptableOverheadRatio); } }
public PreFlexRWFieldsWriter(SegmentWriteState state) { TermsOut = new TermInfosWriter(state.Directory, state.SegmentInfo.Name, state.FieldInfos, state.TermIndexInterval); bool success = false; try { string freqFile = IndexFileNames.SegmentFileName(state.SegmentInfo.Name, "", Lucene3xPostingsFormat.FREQ_EXTENSION); FreqOut = state.Directory.CreateOutput(freqFile, state.Context); TotalNumDocs = state.SegmentInfo.DocCount; success = true; } finally { if (!success) { IOUtils.CloseWhileHandlingException(TermsOut); } } success = false; try { if (state.FieldInfos.HasProx()) { string proxFile = IndexFileNames.SegmentFileName(state.SegmentInfo.Name, "", Lucene3xPostingsFormat.PROX_EXTENSION); ProxOut = state.Directory.CreateOutput(proxFile, state.Context); } else { ProxOut = null; } success = true; } finally { if (!success) { IOUtils.CloseWhileHandlingException(TermsOut, FreqOut); } } SkipListWriter = new PreFlexRWSkipListWriter(TermsOut.SkipInterval, TermsOut.MaxSkipLevels, TotalNumDocs, FreqOut, ProxOut); //System.out.println("\nw start seg=" + segment); }
internal Lucene42NormsConsumer(SegmentWriteState state, string dataCodec, string dataExtension, string metaCodec, string metaExtension, float acceptableOverheadRatio) { this.AcceptableOverheadRatio = acceptableOverheadRatio; MaxDoc = state.SegmentInfo.DocCount; bool success = false; try { string dataName = IndexFileNames.SegmentFileName(state.SegmentInfo.Name, state.SegmentSuffix, dataExtension); Data = state.Directory.CreateOutput(dataName, state.Context); CodecUtil.WriteHeader(Data, dataCodec, Lucene42DocValuesProducer.VERSION_CURRENT); string metaName = IndexFileNames.SegmentFileName(state.SegmentInfo.Name, state.SegmentSuffix, metaExtension); Meta = state.Directory.CreateOutput(metaName, state.Context); CodecUtil.WriteHeader(Meta, metaCodec, Lucene42DocValuesProducer.VERSION_CURRENT); success = true; } finally { if (!success) { IOUtils.CloseWhileHandlingException(this); } } }
public override DocValuesConsumer NormsConsumer(SegmentWriteState state) { DocValuesConsumer consumer = @in.NormsConsumer(state); Debug.Assert(consumer != null); return new AssertingNormsConsumer(consumer, state.SegmentInfo.DocCount); }
/// <summary> /// Returns a <seealso cref="DocValuesConsumer"/> to write norms to the /// index. /// </summary> public abstract DocValuesConsumer NormsConsumer(SegmentWriteState state);
public override FieldsConsumer FieldsConsumer(SegmentWriteState state) { return new AssertingFieldsConsumer(@in.FieldsConsumer(state)); }
// private String segment; /// <summary> /// Creates a <seealso cref="Lucene40PostingsWriter"/>, with the /// <seealso cref="#DEFAULT_SKIP_INTERVAL"/>. /// </summary> public Lucene40PostingsWriter(SegmentWriteState state) : this(state, DEFAULT_SKIP_INTERVAL) { }
public override DocValuesConsumer FieldsConsumer(SegmentWriteState state) { return(new Lucene45DocValuesConsumer(state, DATA_CODEC, DATA_EXTENSION, META_CODEC, META_EXTENSION)); }
/// <summary> /// Creates the <see cref="Codecs.PostingsWriterBase"/> for this /// format. /// </summary> public abstract PostingsWriterBase PostingsWriterBase(SegmentWriteState state);
/// <summary> /// Creates the <seealso cref="PostingsWriterBase"/> for this /// format. /// </summary> public abstract PostingsWriterBase PostingsWriterBase(SegmentWriteState state);
public override FieldsConsumer FieldsConsumer(SegmentWriteState state) { throw UnsupportedOperationException.Create("this codec can only be used for reading"); }
public override DocValuesConsumer NormsConsumer(SegmentWriteState state) { return(new PreFlexRWNormsConsumer(state.Directory, state.SegmentInfo.Name, state.Context)); }
public override FieldsConsumer FieldsConsumer(SegmentWriteState state) { return new PreFlexRWFieldsWriter(state); }
public override PostingsWriterBase PostingsWriterBase(SegmentWriteState state) { return new Lucene41PostingsWriter(state); }
public override DocValuesConsumer NormsConsumer(SegmentWriteState state) { return(new Lucene42NormsConsumer(state, DATA_CODEC, DATA_EXTENSION, METADATA_CODEC, METADATA_EXTENSION, AcceptableOverheadRatio)); }
public FieldsWriter(PerFieldDocValuesFormat outerInstance, SegmentWriteState state) { this.OuterInstance = outerInstance; SegmentWriteState = state; }
/// <summary> /// Returns a <seealso cref="DocValuesConsumer"/> to write docvalues to the /// index. /// </summary> public abstract DocValuesConsumer FieldsConsumer(SegmentWriteState state);
public override sealed DocValuesConsumer FieldsConsumer(SegmentWriteState state) { return new FieldsWriter(this, state); }
public override PostingsWriterBase PostingsWriterBase(SegmentWriteState state) { throw new System.NotSupportedException("this codec can only be used for reading"); }
public override DocValuesConsumer NormsConsumer(SegmentWriteState state) { return new Lucene42NormsConsumer(state, DATA_CODEC, DATA_EXTENSION, METADATA_CODEC, METADATA_EXTENSION, AcceptableOverheadRatio); }
/// <summary> /// Creates a <seealso cref="Lucene40PostingsWriter"/>, with the /// specified {@code skipInterval}. /// </summary> public Lucene40PostingsWriter(SegmentWriteState state, int skipInterval) : base() { this.SkipInterval = skipInterval; this.SkipMinimum = skipInterval; // set to the same for now // this.segment = state.segmentName; string fileName = IndexFileNames.SegmentFileName(state.SegmentInfo.Name, state.SegmentSuffix, Lucene40PostingsFormat.FREQ_EXTENSION); FreqOut = state.Directory.CreateOutput(fileName, state.Context); bool success = false; IndexOutput proxOut = null; try { CodecUtil.WriteHeader(FreqOut, Lucene40PostingsReader.FRQ_CODEC, Lucene40PostingsReader.VERSION_CURRENT); // TODO: this is a best effort, if one of these fields has no postings // then we make an empty prx file, same as if we are wrapped in // per-field postingsformat. maybe... we shouldn't // bother w/ this opto? just create empty prx file...? if (state.FieldInfos.HasProx()) { // At least one field does not omit TF, so create the // prox file fileName = IndexFileNames.SegmentFileName(state.SegmentInfo.Name, state.SegmentSuffix, Lucene40PostingsFormat.PROX_EXTENSION); proxOut = state.Directory.CreateOutput(fileName, state.Context); CodecUtil.WriteHeader(proxOut, Lucene40PostingsReader.PRX_CODEC, Lucene40PostingsReader.VERSION_CURRENT); } else { // Every field omits TF so we will write no prox file proxOut = null; } this.ProxOut = proxOut; success = true; } finally { if (!success) { IOUtils.CloseWhileHandlingException(FreqOut, proxOut); } } TotalNumDocs = state.SegmentInfo.DocCount; SkipListWriter = new Lucene40SkipListWriter(skipInterval, MaxSkipLevels, TotalNumDocs, FreqOut, proxOut); }
public override FieldsConsumer FieldsConsumer(SegmentWriteState state) { throw new NotSupportedException("this codec can only be used for reading"); }
public override DocValuesConsumer FieldsConsumer(SegmentWriteState state) { return new Lucene45DocValuesConsumer(state, DATA_CODEC, DATA_EXTENSION, META_CODEC, META_EXTENSION); }
// note: intentionally ignores seg suffix internal Lucene40DocValuesWriter(SegmentWriteState state, string filename, string legacyKey) { this.State = state; this.LegacyKey = legacyKey; this.Dir = new CompoundFileDirectory(state.Directory, filename, state.Context, true); }
public override DocValuesConsumer FieldsConsumer(SegmentWriteState state) { throw new System.NotSupportedException("this codec can only be used for reading"); }
public override PostingsWriterBase PostingsWriterBase(SegmentWriteState state) { return(new Lucene41PostingsWriter(state)); }
/// <summary> /// expert: Creates a new writer </summary> public Lucene45DocValuesConsumer(SegmentWriteState state, string dataCodec, string dataExtension, string metaCodec, string metaExtension) { bool success = false; try { string dataName = IndexFileNames.SegmentFileName(state.SegmentInfo.Name, state.SegmentSuffix, dataExtension); Data = state.Directory.CreateOutput(dataName, state.Context); CodecUtil.WriteHeader(Data, dataCodec, Lucene45DocValuesFormat.VERSION_CURRENT); string metaName = IndexFileNames.SegmentFileName(state.SegmentInfo.Name, state.SegmentSuffix, metaExtension); Meta = state.Directory.CreateOutput(metaName, state.Context); CodecUtil.WriteHeader(Meta, metaCodec, Lucene45DocValuesFormat.VERSION_CURRENT); MaxDoc = state.SegmentInfo.DocCount; success = true; } finally { if (!success) { IOUtils.CloseWhileHandlingException(this); } } }
public override DocValuesConsumer NormsConsumer(SegmentWriteState state) { return new PreFlexRWNormsConsumer(state.Directory, state.SegmentInfo.Name, state.Context); }