public FieldsReader(PerFieldDocValuesFormat outerInstance, SegmentReadState readState) { this.OuterInstance = outerInstance; // Read _X.per and init each format: bool success = false; try { // Read field name -> format name foreach (FieldInfo fi in readState.FieldInfos) { if (fi.HasDocValues()) { string fieldName = fi.Name; string formatName = fi.GetAttribute(PER_FIELD_FORMAT_KEY); if (formatName != null) { // null formatName means the field is in fieldInfos, but has no docvalues! string suffix = fi.GetAttribute(PER_FIELD_SUFFIX_KEY); Debug.Assert(suffix != null); DocValuesFormat format = DocValuesFormat.ForName(formatName); string segmentSuffix = GetFullSegmentSuffix(readState.SegmentSuffix, GetSuffix(formatName, suffix)); if (!Formats.ContainsKey(segmentSuffix)) { Formats[segmentSuffix] = format.FieldsProducer(new SegmentReadState(readState, segmentSuffix)); } Fields[fieldName] = Formats[segmentSuffix]; } } } success = true; } finally { if (!success) { IOUtils.CloseWhileHandlingException(Formats.Values); } } }
internal FieldsReader(PerFieldDocValuesFormat outerInstance, FieldsReader other) { this.OuterInstance = outerInstance; IDictionary <DocValuesProducer, DocValuesProducer> oldToNew = new HashMap <DocValuesProducer, DocValuesProducer>(); // First clone all formats foreach (KeyValuePair <string, DocValuesProducer> ent in other.Formats) { DocValuesProducer values = ent.Value; Formats[ent.Key] = values; oldToNew[ent.Value] = values; } // Then rebuild fields: foreach (KeyValuePair <string, DocValuesProducer> ent in other.Fields) { DocValuesProducer producer = oldToNew[ent.Value]; Debug.Assert(producer != null); Fields[ent.Key] = producer; } }
internal FieldsReader(PerFieldDocValuesFormat outerInstance, FieldsReader other) { this.OuterInstance = outerInstance; IDictionary<DocValuesProducer, DocValuesProducer> oldToNew = new HashMap<DocValuesProducer, DocValuesProducer>(); // First clone all formats foreach (KeyValuePair<string, DocValuesProducer> ent in other.Formats) { DocValuesProducer values = ent.Value; Formats[ent.Key] = values; oldToNew[ent.Value] = values; } // Then rebuild fields: foreach (KeyValuePair<string, DocValuesProducer> ent in other.Fields) { DocValuesProducer producer = oldToNew[ent.Value]; Debug.Assert(producer != null); Fields[ent.Key] = producer; } }
public FieldsReader(PerFieldDocValuesFormat outerInstance, SegmentReadState readState) { this.OuterInstance = outerInstance; // Read _X.per and init each format: bool success = false; try { // Read field name -> format name foreach (FieldInfo fi in readState.FieldInfos) { if (fi.HasDocValues()) { string fieldName = fi.Name; string formatName = fi.GetAttribute(PER_FIELD_FORMAT_KEY); if (formatName != null) { // null formatName means the field is in fieldInfos, but has no docvalues! string suffix = fi.GetAttribute(PER_FIELD_SUFFIX_KEY); Debug.Assert(suffix != null); DocValuesFormat format = DocValuesFormat.ForName(formatName); string segmentSuffix = GetFullSegmentSuffix(readState.SegmentSuffix, GetSuffix(formatName, suffix)); if (!Formats.ContainsKey(segmentSuffix)) { Formats[segmentSuffix] = format.FieldsProducer(new SegmentReadState(readState, segmentSuffix)); } Fields[fieldName] = Formats[segmentSuffix]; } } } success = true; } finally { if (!success) { IOUtils.CloseWhileHandlingException(Formats.Values); } } }
public FieldsWriter(PerFieldDocValuesFormat outerInstance, SegmentWriteState state) { this.OuterInstance = outerInstance; SegmentWriteState = state; }
public FieldsWriter(PerFieldDocValuesFormat outerInstance, SegmentWriteState state) { this.OuterInstance = outerInstance; SegmentWriteState = state; }