ChrisHegarty commented on code in PR #13570: URL: https://github.com/apache/lucene/pull/13570#discussion_r1681055574
########## lucene/core/src/java21/org/apache/lucene/store/MemorySegmentIndexInputProvider.java: ########## @@ -125,4 +134,31 @@ private final MemorySegment[] map( } return segments; } + + public ConcurrentHashMap<String, RefCountedSharedArena> attachment() { + return new ConcurrentHashMap<>(); + } + + /** + * Gets an arena for the give path, potentially aggregating files from the same segment into a + * single ref counted shared arena. A ref counted shared arena, if created will be added to the + * given arenas map. + */ + static Arena getSharedArena(Path p, ConcurrentHashMap<String, RefCountedSharedArena> arenas) { + String filename = p.getFileName().toString(); + String segmentName = IndexFileNames.parseSegmentName(filename); + if (filename.length() == segmentName.length()) { + // no segment found; just use a shared segment + return Arena.ofShared(); Review Comment: Ok, https://github.com/apache/lucene/pull/13574 is merged, and we have enforcement in the tests to disallow opening `segment_*` with a context other than `READONCE`. Unless I'm mistaken, then this concern has been addressed. -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org