uschindler commented on code in PR #13570: URL: https://github.com/apache/lucene/pull/13570#discussion_r1678835899
########## 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: This is a new Arena so it's private to that file. It's basically a fall ack to current behaviour. -- 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