abernardi597 commented on issue #16392:
URL: https://github.com/apache/lucene/issues/16392#issuecomment-4972874871

   > I'm confused -- segment name is always available in `SegmentReadState`, at 
the lowest level (under `SegmentInfo.name`). Each low level reader uses that to 
construct the file names it then opens. I think we should keep things simple 
and key by the String fileName (what the Codec component passes to 
`Directory.openInput`)?
   
   In the spirit of keeping the changes minimal I did not want to force codecs 
to maintain references to the `SegmentInfo`/file names that otherwise seem to 
be referenced only during construction. To that extent, I had envisioned leaf 
readers just describing via file extension (`vec`, `vex`, `pos`, etc), then the 
wrapping readers prepending information accordingly (e.g. per-field codecs add 
to the file name). Finally `SegmentReader` would be able to complete the file 
names with the `SegmentInfo` it already references.
   
   > this is a per-segment thing, but what does "home" mean? Is it where this 
API is exposed?
   Yes, I mean where the API is exposed at the top level. You could argue for 
making `IndexReader` itself `DiskAccountable` too (aggregating over its 
leaves), but as you mentioned, consumers likely want to cache per-segment 
layouts using `CoreCacheHelper`. At the `IndexReader` level the segment 
geometry would be lost unless it caches internally itself, which is arguably 
too invasive.


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