mikemccand commented on a change in pull request #1848: URL: https://github.com/apache/lucene-solr/pull/1848#discussion_r485499853
########## File path: lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java ########## @@ -73,21 +78,38 @@ // Holds fields seen in each document private PerField[] fields = new PerField[1]; private final InfoStream infoStream; - - DefaultIndexingChain(DocumentsWriterPerThread docWriter) { - this.docWriter = docWriter; - this.fieldInfos = docWriter.getFieldInfosBuilder(); - this.infoStream = docWriter.getIndexWriterConfig().getInfoStream(); + private final ByteBlockPool.Allocator byteBlockAllocator; + private final LiveIndexWriterConfig indexWriterConfig; + private final int indexCreatedVersionMajor; + private final Consumer<Throwable> abortingExceptionConsumer; + private boolean hasHitAbortingException = false; + + DefaultIndexingChain(int indexCreatedVersionMajor, SegmentInfo segmentInfo, Directory directory, FieldInfos.Builder fieldInfos, LiveIndexWriterConfig indexWriterConfig, + Consumer<Throwable> abortingExceptionConsumer) { + this.indexCreatedVersionMajor = indexCreatedVersionMajor; + byteBlockAllocator = new ByteBlockPool.DirectTrackingAllocator(bytesUsed); + IntBlockPool.Allocator intBlockAllocator = new IntBlockAllocator(bytesUsed); + this.indexWriterConfig = indexWriterConfig; + assert segmentInfo.getIndexSort() == indexWriterConfig.getIndexSort(); + this.fieldInfos = fieldInfos; + this.infoStream = indexWriterConfig.getInfoStream(); + this.abortingExceptionConsumer = abortingExceptionConsumer; final TermsHash termVectorsWriter; - if (docWriter.getSegmentInfo().getIndexSort() == null) { - storedFieldsConsumer = new StoredFieldsConsumer(docWriter.codec, docWriter.directory, docWriter.getSegmentInfo()); - termVectorsWriter = new TermVectorsConsumer(docWriter); + if (segmentInfo.getIndexSort() == null) { + storedFieldsConsumer = new StoredFieldsConsumer(indexWriterConfig.getCodec(), directory, segmentInfo); + termVectorsWriter = new TermVectorsConsumer(intBlockAllocator, byteBlockAllocator, directory, segmentInfo, indexWriterConfig.getCodec()); } else { - storedFieldsConsumer = new SortingStoredFieldsConsumer(docWriter.codec, docWriter.directory, docWriter.getSegmentInfo()); - termVectorsWriter = new SortingTermVectorsConsumer(docWriter); + storedFieldsConsumer = new SortingStoredFieldsConsumer(indexWriterConfig.getCodec(), directory, segmentInfo); + termVectorsWriter = new SortingTermVectorsConsumer(intBlockAllocator, byteBlockAllocator, directory, segmentInfo, indexWriterConfig.getCodec()); } - termsHash = new FreqProxTermsWriter(docWriter, bytesUsed, termVectorsWriter); + termsHash = new FreqProxTermsWriter(intBlockAllocator, byteBlockAllocator, bytesUsed, termVectorsWriter); + } + + private void onAbortingException(Throwable th) { Review comment: This was moved from `DWPT`? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org