You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2024/02/29 10:50:58 UTC

(lucene) branch main updated (7b01f2f5166 -> fe7382b2537)

This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git


    from 7b01f2f5166 Make `static final Set` constants immutable (#13087)
     add 1274db1ae6f initial commit for java 21
     add 0343e17fb78 use language tags everywhere for Locales
     add bc4f27d6d01 more language tags
     add 4a49d417a7e bump GH actions
     add d2cdf238f3f use a pickier forLanguageTag
     add 27abd1934d9 fix wrong advice from forbidden APIs :)
     add 5a1cdbe2ef1 Revert "fix wrong advice from forbidden APIs :)"
     add f1c133e8e00 make that java as wordy as possible the way it likes it
     add 073ad432294 run tests with java 21
     add 8bdc6a7aae2 remove javaism completely
     add ef1db180960 Merge branch 'main' into java_21
     add 667125be846 Merge branch 'main' into java_21
     add 83f504aa1d2 Merge branch 'main' into java_21
     add 40c03b0e6c1 Merge branch 'main' into java_21
     add fe0a483dc5c remove ecj snapshot repo
     add 05b23abe928 Merge branch 'main' into java_21
     add 4ef0c044d7e update README.md for java 21
     add d75b869d211 java 17 -> java 21
     add a221b1f6779 java 17 -> java 21
     add 784c331b683 java 17 -> java 21
     add 1f9545e830c remove java < 21
     add fefde0f721a java 17 -> java 21
     add 23ecac438a3 java 17 -> java 21
     add ec04490bd2a java 17 -> java 21
     add d7a16dc10af Merge branch 'main' into java_21
     add 07f4b5b19f7 Merge branch 'main' into java_21
     add c7b05f56bdd post merge fix
     add e63df4d8796 update changes.txt
     add 54b6248a8d4 Merge branch 'main' into java_21
     add 3d7c88e695d fix release wizard
     add 738d661b945 fix smoketester
     add 0ccb1194950 Merge branch 'main' into java_21
     add bfa64b0725f Merge branch 'main' into java_21
     new a356fc1e23f Merge branch 'java_21' of https://github.com/ChrisHegarty/lucene into main
     new fe7382b2537 Deprecate ByteBufferIndexInput and detect MemorySegmentIndexInput correctly in NRTSuggester (#13145)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/actions/prepare-for-build/action.yml                  |  2 +-
 .../hunspell/empty.good => .github/workflows/distribution.yml |  0
 .github/workflows/run-checks-all.yml                          |  4 ++--
 README.md                                                     |  2 +-
 build.gradle                                                  |  2 +-
 buildSrc/build.gradle                                         |  2 +-
 .../main/java/org/apache/lucene/gradle/WrapperDownloader.java |  4 ++--
 dev-tools/scripts/releaseWizard.py                            |  2 +-
 dev-tools/scripts/smokeTestRelease.py                         |  2 +-
 gradle/template.gradle.properties                             |  2 +-
 gradle/validation/ecj-lint/ecj.javadocs.prefs                 |  8 ++++----
 gradlew                                                       |  2 +-
 gradlew.bat                                                   |  2 +-
 lucene/CHANGES.txt                                            | 11 +++++++----
 lucene/SYSTEM_REQUIREMENTS.md                                 |  2 +-
 .../java/org/apache/lucene/store/ByteBufferIndexInput.java    |  6 ++++++
 .../java/org/apache/lucene/store/ByteBuffersDirectory.java    |  7 +++++++
 .../apache/lucene/search/suggest/document/NRTSuggester.java   |  5 ++++-
 18 files changed, 42 insertions(+), 23 deletions(-)
 copy lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/empty.good => .github/workflows/distribution.yml (100%)


(lucene) 01/02: Merge branch 'java_21' of https://github.com/ChrisHegarty/lucene into main

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git

commit a356fc1e23ffc2f569b930f4c3431804df9a1e07
Merge: 7b01f2f5166 bfa64b0725f
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Wed Feb 28 23:59:01 2024 +0100

    Merge branch 'java_21' of https://github.com/ChrisHegarty/lucene into main

 .github/actions/prepare-for-build/action.yml                      | 2 +-
 .github/workflows/distribution.yml                                | 0
 .github/workflows/run-checks-all.yml                              | 4 ++--
 README.md                                                         | 2 +-
 build.gradle                                                      | 2 +-
 buildSrc/build.gradle                                             | 2 +-
 .../src/main/java/org/apache/lucene/gradle/WrapperDownloader.java | 4 ++--
 dev-tools/scripts/releaseWizard.py                                | 2 +-
 dev-tools/scripts/smokeTestRelease.py                             | 2 +-
 gradle/template.gradle.properties                                 | 2 +-
 gradle/validation/ecj-lint/ecj.javadocs.prefs                     | 8 ++++----
 gradlew                                                           | 2 +-
 gradlew.bat                                                       | 2 +-
 lucene/CHANGES.txt                                                | 6 +++---
 lucene/SYSTEM_REQUIREMENTS.md                                     | 2 +-
 15 files changed, 21 insertions(+), 21 deletions(-)



(lucene) 02/02: Deprecate ByteBufferIndexInput and detect MemorySegmentIndexInput correctly in NRTSuggester (#13145)

Posted by us...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git

commit fe7382b25378d9e4bb97f5b30423de834b499c7c
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Thu Feb 29 11:49:04 2024 +0100

    Deprecate ByteBufferIndexInput and detect MemorySegmentIndexInput correctly in NRTSuggester (#13145)
---
 lucene/CHANGES.txt                                                 | 5 ++++-
 .../src/java/org/apache/lucene/store/ByteBufferIndexInput.java     | 6 ++++++
 .../src/java/org/apache/lucene/store/ByteBuffersDirectory.java     | 7 +++++++
 .../org/apache/lucene/search/suggest/document/NRTSuggester.java    | 5 ++++-
 4 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 16a3714898e..be9033a6745 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -182,7 +182,8 @@ Other
 
 API Changes
 ---------------------
-(No changes)
+
+* GITHUB#13145: Deprecate ByteBufferIndexInput as it will be removed in Lucene 10.0. (Uwe Schindler)
 
 New Features
 ---------------------
@@ -213,6 +214,8 @@ Bug Fixes
 * GITHUB#13105: Fix ByteKnnVectorFieldSource & FloatKnnVectorFieldSource to work correctly when a segment does not contain
   any docs with vectors (hossman)
 
+* GITHUB#13145: Detect MemorySegmentIndexInput correctly in NRTSuggester. (Uwe Schindler)
+
 Other
 ---------------------
 
diff --git a/lucene/core/src/java/org/apache/lucene/store/ByteBufferIndexInput.java b/lucene/core/src/java/org/apache/lucene/store/ByteBufferIndexInput.java
index 6d6040bd437..04c78a10242 100644
--- a/lucene/core/src/java/org/apache/lucene/store/ByteBufferIndexInput.java
+++ b/lucene/core/src/java/org/apache/lucene/store/ByteBufferIndexInput.java
@@ -33,7 +33,13 @@ import java.nio.LongBuffer;
  *
  * <p>For efficiency, this class requires that the buffers are a power-of-two (<code>chunkSizePower
  * </code>).
+ *
+ * @deprecated This class was made public for internal reasons ({@code instanceof} checks). In
+ *     {@link MMapDirectory} it was replaced by {@code MemorySegment} based {@link IndexInput}
+ *     implementations and will be no longer required in Lucene 10.
+ * @lucene.internal
  */
+@Deprecated
 public abstract class ByteBufferIndexInput extends IndexInput implements RandomAccessInput {
   private static final FloatBuffer EMPTY_FLOATBUFFER = FloatBuffer.allocate(0);
   private static final LongBuffer EMPTY_LONGBUFFER = LongBuffer.allocate(0);
diff --git a/lucene/core/src/java/org/apache/lucene/store/ByteBuffersDirectory.java b/lucene/core/src/java/org/apache/lucene/store/ByteBuffersDirectory.java
index 1b65ffa43b7..dbefd6a03cc 100644
--- a/lucene/core/src/java/org/apache/lucene/store/ByteBuffersDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/ByteBuffersDirectory.java
@@ -82,6 +82,13 @@ public final class ByteBuffersDirectory extends BaseDirectory {
   public static final BiFunction<String, ByteBuffersDataOutput, IndexInput> OUTPUT_AS_BYTE_ARRAY =
       OUTPUT_AS_ONE_BUFFER;
 
+  /**
+   * Use {@link ByteBufferIndexInput} for reading, otherwise identical to {@link
+   * #OUTPUT_AS_MANY_BUFFERS}.
+   *
+   * @deprecated Use {@link #OUTPUT_AS_MANY_BUFFERS} instead.
+   */
+  @Deprecated
   public static final BiFunction<String, ByteBuffersDataOutput, IndexInput>
       OUTPUT_AS_MANY_BUFFERS_LUCENE =
           (fileName, output) -> {
diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/NRTSuggester.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/NRTSuggester.java
index f47ac040601..4f6936ee205 100644
--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/NRTSuggester.java
+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/NRTSuggester.java
@@ -325,7 +325,10 @@ public final class NRTSuggester implements Accountable {
       case OFF_HEAP:
         return true;
       case AUTO:
-        return input instanceof ByteBufferIndexInput;
+        // TODO: Make this less hacky to maybe expose "off-heap" feature using a marker interface on
+        // the IndexInput
+        return input instanceof ByteBufferIndexInput
+            || input.getClass().getName().contains(".MemorySegmentIndexInput");
       default:
         throw new IllegalStateException("unknown enum constant: " + fstLoadMode);
     }