john-mlika commented on code in PR #16481:
URL: https://github.com/apache/lucene/pull/16481#discussion_r3717125583
##########
lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:
##########
@@ -5372,32 +5376,36 @@ public int length() {
context,
intraMergeExecutor,
merge);
- merge.info.setSoftDelCount(Math.toIntExact(softDeleteCount.get()));
- merge.checkAborted();
-
MergeState mergeState = merger.mergeState;
MergeState.DocMap[] docMaps;
- if (reorderDocMaps == null) {
- docMaps = mergeState.docMaps;
- } else {
- // Since the reader was reordered, we passed a merged view to
MergeState and from its
- // perspective there is a single input segment to the merge and the
- // SlowCompositeCodecReaderWrapper is effectively doing the merge.
- assert mergeState.docMaps.length == 1
- : "Got " + mergeState.docMaps.length + " docMaps, but expected 1";
- MergeState.DocMap compactionDocMap = mergeState.docMaps[0];
- docMaps = new MergeState.DocMap[reorderDocMaps.length];
- for (int i = 0; i < docMaps.length; ++i) {
- MergeState.DocMap reorderDocMap = reorderDocMaps[i];
- docMaps[i] = docID -> compactionDocMap.get(reorderDocMap.get(docID));
+ try {
+ merge.info.setSoftDelCount(Math.toIntExact(softDeleteCount.get()));
+ merge.checkAborted();
+
+ if (reorderDocMaps == null) {
+ docMaps = mergeState.docMaps;
+ } else {
+ // Since the reader was reordered, we passed a merged view to
MergeState and from its
+ // perspective there is a single input segment to the merge and the
+ // SlowCompositeCodecReaderWrapper is effectively doing the merge.
+ assert mergeState.docMaps.length == 1
+ : "Got " + mergeState.docMaps.length + " docMaps, but expected
1";
+ MergeState.DocMap compactionDocMap = mergeState.docMaps[0];
+ docMaps = new MergeState.DocMap[reorderDocMaps.length];
+ for (int i = 0; i < docMaps.length; ++i) {
+ MergeState.DocMap reorderDocMap = reorderDocMaps[i];
+ docMaps[i] = docID ->
compactionDocMap.get(reorderDocMap.get(docID));
+ }
}
- }
- merge.mergeStartNS = System.nanoTime();
+ merge.mergeStartNS = System.nanoTime();
Review Comment:
don't think so? the line just moved inside the try block
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]