SegmentDocValuesProducer(SegmentCommitInfo si,Directory dir,FieldInfos coreInfos,FieldInfos allInfos,SegmentDocValues segDocValues) throws IOException {
  boolean success=false;
  try {
    DocValuesProducer baseProducer=null;
    for (    FieldInfo fi : allInfos) {
      if (fi.getDocValuesType() == DocValuesType.NONE) {
        continue;
      }
      long docValuesGen=fi.getDocValuesGen();
      if (docValuesGen == -1) {
        if (baseProducer == null) {
          baseProducer=segDocValues.getDocValuesProducer(docValuesGen,si,dir,coreInfos);
          dvGens.add(docValuesGen);
          dvProducers.add(baseProducer);
        }
        dvProducersByField.put(fi.name,baseProducer);
      }
 else {
        assert !dvGens.contains(docValuesGen);
        final DocValuesProducer dvp=segDocValues.getDocValuesProducer(docValuesGen,si,dir,new FieldInfos(new FieldInfo[]{fi}));
        dvGens.add(docValuesGen);
        dvProducers.add(dvp);
        dvProducersByField.put(fi.name,dvp);
      }
    }
    success=true;
  }
  finally {
    if (success == false) {
      try {
        segDocValues.decRef(dvGens);
      }
 catch (      Throwable t) {
      }
    }
  }
}

SegmentDocValuesProducer ( SegmentCommitInfo si , Directory dir , FieldInfos coreInfos , FieldInfos allInfos , SegmentDocValues segDocValues ) throws IOException { boolean success = false ; try { DocValuesProducer baseProducer = null ; for ( FieldInfo fi : allInfos ) { if ( fi . getDocValuesType ( ) == DocValuesType . NONE ) { continue ; } long docValuesGen = fi . getDocValuesGen ( ) ; if ( docValuesGen == - 1 ) { if ( baseProducer == null ) { baseProducer = segDocValues . getDocValuesProducer ( docValuesGen , si , dir , coreInfos ) ; dvGens . add ( docValuesGen ) ; dvProducers . add ( baseProducer ) ; } dvProducersByField . put ( fi . name , baseProducer ) ; } else { assert ! dvGens . contains ( docValuesGen ) ; final DocValuesProducer dvp = segDocValues . getDocValuesProducer ( docValuesGen , si , dir , new FieldInfos ( new FieldInfo [ ] { fi } ) ) ; dvGens . add ( docValuesGen ) ; dvProducers . add ( dvp ) ; dvProducersByField . put ( fi . name , dvp ) ; } } success = true ; } finally { if ( success == false ) { try { segDocValues . decRef ( dvGens ) ; } catch ( Throwable t ) { } } } }
creates a new producer that handles updated docvalues fields
