thecoop commented on code in PR #16970:
URL: https://github.com/apache/lucene/pull/16970#discussion_r4456585708


##########
lucene/core/src/java/org/apache/lucene/store/IOContext.java:
##########
@@ -64,6 +64,15 @@ interface FileOpenHint {}
   @SuppressWarnings("ClassInitializationDeadlock") // FIXME: may cause hangs!
   IOContext READONCE = new DefaultIOContext(DataAccessHint.SEQUENTIAL, 
ReadOnceHint.INSTANCE);
 
+  /**
+   * A default context for reads with {@link ReadAdvice#RANDOM}.
+   *
+   * <p>This context should only be used when the read operations will be 
performed in the same
+   * thread as the thread that opens the underlying storage.
+   */
+  @SuppressWarnings("ClassInitializationDeadlock") // FIXME: may cause hangs!
+  IOContext RANDOM_READONCE = new DefaultIOContext(DataAccessHint.RANDOM, 
ReadOnceHint.INSTANCE);

Review Comment:
   The name should reflect the thread-unsafe aspect, as that is not something 
usually associated with IO. Maybe `RANDOM_READONCE_SINGLETHREAD`



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