ChrisHegarty commented on code in PR #16682:
URL: https://github.com/apache/lucene/pull/16682#discussion_r4069933438


##########
lucene/core/src/java/org/apache/lucene/index/SegmentWriteState.java:
##########
@@ -113,6 +113,19 @@ public SegmentWriteState(
     this.context = context;
   }
 
+  /** Create a shallow copy of {@link SegmentWriteState} with a new {@link 
IOContext}. */
+  public SegmentWriteState(SegmentWriteState state, IOContext context) {
+    infoStream = state.infoStream;
+    directory = state.directory;
+    segmentInfo = state.segmentInfo;
+    fieldInfos = state.fieldInfos;
+    this.context = context;
+    segmentSuffix = state.segmentSuffix;
+    segUpdates = state.segUpdates;
+    delCountOnFlush = state.delCountOnFlush;
+    liveDocs = state.liveDocs;
+  }
+

Review Comment:
   Similar to SegmentReadState above.
   ```
     // Replace this state's context with a fixed set of hints
     public SegmentWriteState withHints(IOContext.FileOpenHint... hints) {
       return new SegmentWriteState(this, context.withHints(hints));
     }
   ```
   



-- 
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]

Reply via email to