From 397c2e547a15c1a87c6618c49ebb9e29f3a32e22 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Fri, 5 May 2023 12:04:38 +0200 Subject: [PATCH] Fix MMapDirectory documentation for Java 20 (#12265) --- .../org/apache/lucene/store/MMapDirectory.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java b/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java index 58be07ab437..9ca636b4cd7 100644 --- a/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java +++ b/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java @@ -76,9 +76,9 @@ import org.apache.lucene.util.SuppressForbidden; *
  • {@code permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";} * * - *

    On exactly Java 19 this class will use the modern {@code MemorySegment} API which - * allows to safely unmap (if you discover any problems with this preview API, you can disable it by - * using system property {@link #ENABLE_MEMORY_SEGMENTS_SYSPROP}). + *

    On exactly Java 19 and Java 20 this class will use the modern {@code + * MemorySegment} API which allows to safely unmap (if you discover any problems with this preview + * API, you can disable it by using system property {@link #ENABLE_MEMORY_SEGMENTS_SYSPROP}). * *

    NOTE: Accessing this class either directly or indirectly from a thread while it's * interrupted can close the underlying channel immediately if at the same time the thread is @@ -123,7 +123,7 @@ public class MMapDirectory extends FSDirectory { * Default max chunk size: * *

    @@ -198,9 +198,9 @@ public class MMapDirectory extends FSDirectory { * files cannot be mapped. Using a lower chunk size makes the directory implementation a little * bit slower (as the correct chunk may be resolved on lots of seeks) but the chance is higher * that mmap does not fail. On 64 bit Java platforms, this parameter should always be large (like - * 1 GiBytes, or even larger with Java 19), as the address space is big enough. If it is larger, - * fragmentation of address space increases, but number of file handles and mappings is lower for - * huge installations with many open indexes. + * 1 GiBytes, or even larger with recent Java versions), as the address space is big enough. If it + * is larger, fragmentation of address space increases, but number of file handles and mappings is + * lower for huge installations with many open indexes. * *

    Please note: The chunk size is always rounded down to a power of 2. *