shubhamsrkdev opened a new issue, #15634: URL: https://github.com/apache/lucene/issues/15634
### Description [MMapDirectory.java](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java) has 4 constructors and setters like `setPreload()` and `setReadAdvice()`. I see two issues here: - Adding new arguments require permutation of constructors arguments and could lead to more growth in number of constructors. - Since these setters can be called anytime after creation of a MMapDirectory instance, I am not sure if they are safe. Because configuration is mutable via setters, a change made by one thread (e.g., toggling preload) can lead to inconsistent behavior in other threads? I think Builder pattern could be better suited here, it would eliminate need of multiple constructors and would make the MMapDirectory instance immutable. I am happy to contribute a PR but would love to hear thoughts on it as it will be a big API change. -- 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]
