uschindler commented on issue #15634:
URL: https://github.com/apache/lucene/issues/15634#issuecomment-3833561413

   I have similar concerns. Actually the directory instance is normally not 
used by end user code. Basically everybody should use `FSDirectory#open()`, 
Using MMapDir directly is very expert. I know it is a mix of instance fields 
with setters and at same time
   
   Two of the current ctors are "standardized" across all directory 
implementations. You always have at least two: one with path and one with lock 
factory. If you want to change this it needs to be done for all directory 
implementations. Lots of code requires the two standard ctors: test framework 
for its randomization and Luke. The additional 2 ones with chunk size could in 
my opinion also be replaced by a setter, but that's historical.
   
   > Adding new arguments require permutation of constructors arguments and 
could lead to more growth in number of constructors.
   
   The last time this was done was maybe 10 or 12 years ago. 😜
   
   The setters is not a big concern. They are not threadsafe, but changing them 
at runtime does not do too much harm and I don't see this as a big problem.
   
   In general I am also a fan of immutable instances but a directory has state, 
so all of them are not fully thread safe regarding their internal state.
   
   Uwe


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