uschindler commented on code in PR #13570:
URL: https://github.com/apache/lucene/pull/13570#discussion_r1679007057
##########
lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java:
##########
@@ -199,20 +202,27 @@ public IndexInput openInput(String name, IOContext
context) throws IOException {
ensureOpen();
ensureCanRead(name);
Path path = directory.resolve(name);
- return PROVIDER.openInput(path, context, chunkSizePower,
preload.test(name, context));
+ return PROVIDER.openInput(
+ path, context, chunkSizePower, preload.test(name, context),
attachment);
}
// visible for tests:
- static final MMapIndexInputProvider PROVIDER;
+ static final MMapIndexInputProvider<Object> PROVIDER;
- interface MMapIndexInputProvider {
- IndexInput openInput(Path path, IOContext context, int chunkSizePower,
boolean preload)
+ interface MMapIndexInputProvider<A> {
+ IndexInput openInput(
+ Path path, IOContext context, int chunkSizePower, boolean preload, A
attachment)
throws IOException;
long getDefaultMaxChunkSize();
boolean supportsMadvise();
+ /** An optional attachment of the provider, that will be passed to
openInput. */
Review Comment:
I like it more generic. Its an implementation detail of the private
provider. In Lucene 9.x we have another implementation which is a noop, but we
don't have the term Arena there. Also in JDK 19 it is called "Session".
--
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]